Multiplication of matrices with Multiple variables
Afficher commentaires plus anciens
I have 4 matrices, each with 4 different variables. i.e. Matrix 1 with variable x, 2 with y and so on. How do I multiply them for different values of each variable?
T1 = [cos(th1) 0 -sin(th1) 0; sin(th1) 0 -cos(th1) 0; 0 -1 0 0; 0 0 0 1];
T2 = [cos(th2) -sin(th2) 0 (260*cos(th2)); sin(th2) cos(th2) 0 (260*sin(th2)) ; 0 0 1 0; 0 0 0 1];
T3 = [cos(th3) 0 sin(th3) (-30*cos(th3)); sin(th3) 0 -cos(th3) (-30*sin(th3)) ; 0 1 0 0; 0 0 0 1];
T4 = [cos(th4) 0 sin(th4) 0; sin(th4) 0 -cos(th4) 0; 0 1 0 270; 0 0 0 1];
T5 = [cos(th5) 0 sin(th5) 0; sin(th5) 0 -cos(th5) 0; 0 1 0 0; 0 0 0 1];
T6 = [cos(th6) -sin(th6) 0 0; sin(th6) cos(th6) 0 0; 0 0 1 90; 0 0 0 1];
T = T1 * T2 * T3 * T4 * T5 * T6;
%case I
th1 = 0;
th2 = 0;
th3 = 0;
th4 = 0;
th5 = 0;
th6 = 0;
display("Case 1");
display(T);
%case II
th1 = pi/2;
th2 = 0;
th3 = pi;
th4 = 0;
th5 = 0;
th6 = 0;
display("Case 2");
display(T);
Returns the same value
4 commentaires
Raj
le 15 Avr 2019
Your problem statement is not clear. Can you elaborate possibly with data?
Anush Karki
le 15 Avr 2019
Raj
le 15 Avr 2019
ok so what exactly is the problem here?
Anush Karki
le 15 Avr 2019
Modifié(e) : Anush Karki
le 15 Avr 2019
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Software Development dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!