I’m looking for an easy and fast solution to the following problem: I have three 3D vectors x_i, three 3D vectors y_i, a 3D vector b and a 3×3 matrix A with coefficients a11 – a33 (that are unknown).
The relation is as follows:
x_i = A * y_i + b
That resolves to
x_i_1 = ( a11 * y_1_1 + a12 * y_2_1 + a13 * y_3_1 ) + b_1
etc.
So there are 9 equations and 9 unknown variables a11 – a33, easy peasy math. But how do I solve this system using build in Matlab functions?
If you know the 9 equations and 9 unknowns, then just pretend like the 9 unknowns live in a column vector called
r, and write the rows of a 9×9 matrix calledCto store the coefficients. If the left-hand side of the 9 equations is also stored in a column vectorxthen you’ll be solving something likeAnd this is simply done in Matlab with
Now
rstores the solution for the 9 unknowns (assuming that solutions exist, etc.)