http://www.mathworks.com/matlabcentral/newsreader/view_thread/294290
MATLAB Central Newsreader  Solve system of equations
Feed for thread: Solve system of equations
enus
©19942015 by MathWorks, Inc.
webmaster@mathworks.com
MATLAB Central Newsreader
http://blogs.law.harvard.edu/tech/rss
60
MathWorks
http://www.mathworks.com/images/membrane_icon.gif

Tue, 19 Oct 2010 22:22:04 +0000
Solve system of equations
http://www.mathworks.com/matlabcentral/newsreader/view_thread/294290#789034
George34 Dampf
Hello,<br>
<br>
i have a lots of equations in the following form:<br>
<br>
m = R*x +t<br>
<br>
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.<br>
<br>
I would like to ask if there is any way to get a solution for R and t? How do I solve it matlab?<br>
<br>
Thanks in advance

Tue, 19 Oct 2010 23:49:03 +0000
Re: Solve system of equations
http://www.mathworks.com/matlabcentral/newsreader/view_thread/294290#789045
Roger Stafford
"George34 Dampf" <lichtamendedessargs@googlemail.com> wrote in message <i9l5mc$iof$1@fred.mathworks.com>...<br>
> Hello,<br>
> <br>
> i have a lots of equations in the following form:<br>
> <br>
> m = R*x +t<br>
> <br>
> 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.<br>
> <br>
> I would like to ask if there is any way to get a solution for R and t? How do I solve it matlab?<br>
> <br>
> Thanks in advance <br>
         <br>
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:<br>
<br>
M = Rt*X<br>
<br>
This can be solved by matlab's matrix division operator:<br>
<br>
Rt = M/X;<br>
<br>
Then<br>
<br>
R = Rt(:,1:3);<br>
t = Rt(:,4);<br>
<br>
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.<br>
<br>
Roger Stafford

Wed, 20 Oct 2010 15:14:05 +0000
Re: Solve system of equations
http://www.mathworks.com/matlabcentral/newsreader/view_thread/294290#789215
George34 Dampf
Thank you very much!!