how would I go about solving this matrix equation with a non-square matrix?
I can't find the inverse obviously so I can't just do X = A^-1 B
>>8519805
Write matrix X with some arbitrary coefficients, then multiply the matrices on the left side and solve the system of equations
First X must be a 2x3 matrix
3a+2d = 3
4a + 3d = 1
1a +0d = 7 => a= 7
...
keep solving from there.
>>8519805
you might try
A x = B
A^t A x = A^t B
x = (A^t A)^(-1) A^t B
If there is an x that works, this will give it to you. You have to check that it works though.
>>8519836
this is great, thanks
by X working you just mean that there is a solution, right?
>>8519836
That's the fun way:D
>>8519805
You're mistaken, it does have a left inverse.
[math]\begin{pmatrix} a^\top \\ b^\top \end{pmatrix} \begin{pmatrix}u & v \end{pmatrix} = \begin{pmatrix} a^\top u & a^\top v \\ b^\top u & b^\top v\end{pmatrix} = I[/math]
You just need to find 2 other 3D vectors that are mutually orthonormal to these 2.
>>8519838
I mean you have to take the x you get and check that Ax = B, i.e. plug it back in and check. This is because the implication in the math above doesn't go both ways
>>8519805
The inverse of A exists, it's:
[math]\begin{pmatrix}3 & -2& 0 \\ -4 & 3 & 0\end{pmatrix}[/math]
Try it out. Left multiply and solve.
>>8520779
there are infinitely many inverses tho. do all inverses give the same result?
>>8520794
oh then parametrize the inverse then to get all the answers then maybe
>>8520808
could try but I'm lazy.
doesn't matrix multiplication associativity assert that no matter what matrix you use, it will give the same result?
>>8519836
A=[3 2; 4 3; 1 0];
B=[3 9 7; 1 11 7; 7 5 7];
x=inv(A'*A)*A'*B
error=max(max(abs(A*x-B)))
gives
x =
7.0000 5.0000 7.0000
-9.0000 -3.0000 -7.0000
error = 4.4409e-14
It works.
>>8519805
The system is over-determined (9 equations in 6 unknowns). Reduce it to 6 equations by discarding any one row from both matrices. Then you have A'.X=B' where A' is 2x2 and B' is 2x3. A' can be inverted, and you can just use X=A'^-1.B.
Multiplying the discarded row of A by X should then give you the discarded row of B. If it doesn't, the system is inconsistent (i.e. there is no matrix X satisfying the equation).