Prev: BMP to HEX File
Next: matlab and ajax
From: Hugh on 17 Mar 2010 15:04 Hi there, I need to invert a system of matrices where B * X * C' = R (10*2)*(2*1)*(1*10) =(10*10) B, C and R are already known and I just need to solve for X. Can I do this by simply applying pseudoinverse twice? i.e. X*C'=R\B X= (R\B)\C' I am converned that given the matrix multiplication is non-commutative that the order in which apply the pseudoinverese wither B first or C first will affect the answer. If this is not correct please advise which functions I should use instread.
From: Matt J on 17 Mar 2010 15:25 "Hugh " <h_a_patience(a)hotmail.com> wrote in message <hnr935$lko$1(a)fred.mathworks.com>... > Hi there, > > I need to invert a system of matrices where > > B * X * C' = R > (10*2)*(2*1)*(1*10) =(10*10) > > B, C and R are already known and I just need to solve for X. > > Can I do this by simply applying pseudoinverse twice? > > i.e. > > X*C'=R\B > > X= (R\B)\C' > > I am converned that given the matrix multiplication is non-commutative that the order in which apply the pseudoinverese wither B first or C first will affect the answer. =========== It should be fine (if not let me know). Note that your equation can also be expressed as follows: kron(C,B)*X(:)=R(:) and hence inverted by X(:)= pinv(kron(C,B)) *R(:) But pinv() is distrbutable across Kronecker product operands, so this becomes X(:)= kron( pinv(C), pinv(B) ) *R(:) which is equivalent to what you had before. Incidentally, you can do the inversion with a simpler syntax if you use my KronProd tool http://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-kronecker-product-manipulation A=KronProd({B,C},[1,2]); X=A\R; OK, so it takes some additional syntax to construct the A object, but if you need A for other computations, it can be handy to have around.
From: Matt J on 17 Mar 2010 15:45 "Hugh " <h_a_patience(a)hotmail.com> wrote in message <hnr935$lko$1(a)fred.mathworks.com>... > > X*C'=R\B > > X= (R\B)\C' Actually, this should really be X*C'=B\R X=(B\R)/(C')
From: Hugh on 17 Mar 2010 15:57 "Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hnrbgp$42g$1(a)fred.mathworks.com>... > "Hugh " <h_a_patience(a)hotmail.com> wrote in message <hnr935$lko$1(a)fred.mathworks.com>... > > > > > X*C'=R\B > > > > X= (R\B)\C' > > Actually, this should really be > > X*C'=B\R > > X=(B\R)/(C') thanks Matt J I had realised about the left and right division. I will try it both ways will prvide some sort of reassurance and will let you know how I get on. thanks agian
From: Hugh on 18 Mar 2010 11:32
"Matt J " <mattjacREMOVE(a)THISieee.spam> wrote in message <hnraal$d4d$1(a)fred.mathworks.com>... > "Hugh " <h_a_patience(a)hotmail.com> wrote in message <hnr935$lko$1(a)fred.mathworks.com>... > > Hi there, > > > > I need to invert a system of matrices where > > > > B * X * C' = R > > (10*2)*(2*1)*(1*10) =(10*10) > > > > B, C and R are already known and I just need to solve for X. > > > > Can I do this by simply applying pseudoinverse twice? > > > > i.e. > > > > X*C'=R\B > > > > X= (R\B)\C' > > Hi Matt, I went to downlaod your fuinction but there seems to be alot of files associated with it (75 in all) do I have to install them all? I just want to do the calculation discussed in this thread? > > I am converned that given the matrix multiplication is non-commutative that the order in which apply the pseudoinverese wither B first or C first will affect the answer. > =========== > > It should be fine (if not let me know). > > Note that your equation can also be expressed as follows: > > kron(C,B)*X(:)=R(:) > > and hence inverted by > > X(:)= pinv(kron(C,B)) *R(:) > > But pinv() is distrbutable across Kronecker product operands, so this becomes > > X(:)= kron( pinv(C), pinv(B) ) *R(:) > > which is equivalent to what you had before. > > > Incidentally, you can do the inversion with a simpler syntax if you use my KronProd tool > > http://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-oriented-kronecker-product-manipulation > > A=KronProd({B,C},[1,2]); > > X=A\R; > > OK, so it takes some additional syntax to construct the A object, but if you need A for other computations, it can be handy to have around. |