Quaternionic least squares (
QLS) problem is one method of solving overdetermined sets of quaternion linear equations
AX≈B that is appropriate when there is error in the matrix
B. In this paper, by means of complex representation of a quaternion matrix, we introduce a concept of norm of quaternion matrices, discuss singular values and generalized inverses of a quaternion matrix, study the QLS problem and derive two algebraic methods for finding solutions of the QLS problem in quaternionic quantum theory.