Use of 3D array. Find inverse of individual page
Mostra commenti meno recenti
My program contains a 3x3x100 matrix. I need to find A=J\B where J is each page of the 3x3x100 matrix ( i.e. 100 numbers of 3x3 matrix) and B is a 3x1 matrix. Which would result in matrix A to be of dimension 3x100
How do i solve this. One of the ways might be to generate a loop 100 times. But i was looking for more efficient way. May by using the matrix directly. Please help.
I have attached the codes incase it helps.
function[J]=Jacobian(t1,t2,t3)
global l1 l2 l3;
%t1 t2 and t3 would be 1x100 matrices each.
J{1,1}=-(l1+l2.*cos(t2)+l3.*cos(t2+t3)).*sin(t1);
J{1,2}=-(l2.*sin(t2)+l3.*sin(t2+t3)).*cos(t1);
J{1,3}=-l3.*sin(t2+t3).*cos(t1);
J{2,1}=(l1+l2.*cos(t2)+l3.*cos(t2+t3)).*cos(t1);
J{2,2}=-(l2.*sin(t2)+l3.*sin(t2+t3)).*sin(t1);
J{2,3}=-l3.*sin(t2+t3).*sin(t1);
J{3,1}=0;
J{3,2}=l2.*cos(t2)+l3.*cos(t2+t3);
J{3,3}=l3.*cos(t2+t3);
function[]=Support(A,B)
%.....
J=Jacobian(M1(1,:),M1(2,:),M1(3,:))
vx=(B(1)-A(1))/2.5
vy=0;
vz=0;
V=[vx;vy;vz];
Td=J\V
This is the error i get
??? Undefined function or method 'mldivide' for input arguments of type 'cell'.
Error in ==> Support at 11 Td=J\V
Risposta accettata
Più risposte (1)
James Tursa
il 9 Giu 2011
0 voti
See this small size linear solver by Bruno Luong:
and you might be interested in this one as well:
Categorie
Scopri di più su Matrices and Arrays in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!