M BUZZ CRAZE NEWS
// general

Divide matrix using left division

By John Parsons
$\begingroup$

In matlab, I defined

a=[1;2;3]
b=[4;5;6]

both a and b are not square matrix.

and execute a\b will return 2.2857

From various sources, we understand that a\b ~= inv(a)*b, but in my case, a is not a square matrix, thus we can't perform an inverse operation on it.

I am actually translating matlab code to c#, and I need to know how do left division between non-square matrix calculated.

Thanks!

$\endgroup$

1 Answer

$\begingroup$

In Matlab $a $\ $b =(a'a)^{-1}a'b$, i.e. $b$ is projected onto $a$.

A little bit more information: Consider, $$ b \approx ax $$ where $x$ is unknown and there are no exact solutions i.e. $b$ and $a$ have many rows and few columns, then the typical way to solve this problem is to solve for $x$ by projecting $b$ onto $a$ or by taking the point on the space $a$, which is closest to be i.e. $b \approx P_ab=a(a'a)^{-1}a'b=ax$.

$\endgroup$ 2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy