"George34 Dampf" <lichtamendedessargs@googlemail.com> wrote in message <i9l5mc$iof$1@fred.mathworks.com>...
> Hello,
>
> i have a lots of equations in the following form:
>
> m = R*x +t
>
> where m (3x1) and x(3x1) are given and R(3x3) and t(3x1) are the matrix and the vector i would like to calculate. So R and t are the same for every equation and m and x are varying.
>
> I would like to ask if there is any way to get a solution for R and t? How do I solve it matlab?
>
> Thanks in advance
         
Suppose there are n ("lots") sets of equations of the form m = R*x+t. Define M as the 3 x n matrix in which each column is one of the m sets. Define X as the 4 x n matrix in which the top three of each column is a corresponding x set and the bottom element is a 1. Define Rt = [R,t] which are the 12 unknowns. Then your entire set of equations is equivalent to:
M = Rt*X
This can be solved by matlab's matrix division operator:
Rt = M/X;
Then
R = Rt(:,1:3);
t = Rt(:,4);
Note: If n is less than 4, there would be infinitely many exact solutions in general. If n is greater than 4, in general you will only get a least squares approximation. With n equal to 4, in general there will be just one exact solution.
Roger Stafford
