Got Questions? Get Answers.
Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Solve system of equations

Subject: Solve system of equations

From: George34 Dampf

Date: 19 Oct, 2010 22:22:04

Message: 1 of 3

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

Subject: Solve system of equations

From: Roger Stafford

Date: 19 Oct, 2010 23:49:03

Message: 2 of 3

"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

Subject: Solve system of equations

From: George34 Dampf

Date: 20 Oct, 2010 15:14:05

Message: 3 of 3

Thank you very much!!

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us