Matrices and vectors with quaternion elements Are matrices and vectors with quaternion elements useful for anything?
I built a linear algebra package in Java that can have real, complex, rational and/or quaternion elements. Quaternions are supported simply because that class implements the same interfaces as the other scalar/element classes.
I know something about what quaternions can be used for (graphics, robotics...) but I do not know how exactly how they're used in those cases. What kind of data structures are they put into, and how would one operate on those data structures.
Can it make sense do matrix multiplication (or calculate some decomposition) using matrices with quaternion elements?
 A: Yes, they are useful, certainly in pure mathematics, and also theoretical physics (I don't know much about engineering).  Here is a rough idea.
The most direct way quaternions are "useful" is to use quaternions to represent SO(3), the group of rotations about the origin in 3-space (which comes up in various engineering problems including robotics).  If you want to think in terms of matrices and vectors, the rotations are given by invertible (i.e., nonzero) 1-by-1 quaternionic matrices (up to scalars in $\mathbb R^\times$) and the 3-d representation space is the space of vectors of length 1 of pure quaternions.  
SO(3) is called a (special) orthogonal group, and you can use certain subsets of matrices over the quaternions to represent higher-dimensional orthogonal groups as well.  For instance, SO(5) (rotations about the origin in a 5-dimensional real vector space) can be represented by a certain subset of 2-by-2 matrices over the quaternions.  (It is something like the
set of invertible $g \in M_2(\mathbb H)$ such that $\bar g^T g = I$ up to scalars, where the bar denotes componentwise conjugation and $T$ is transpose, though I am going of memory here so this might be slightly off.)
These should then act as rotations by matrix multiplication on a certain (sub)space of quaternionic vectors of length 2.
