How to simulate the matrix in Simulink
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Dear everyone, I have matrix that has variable in it and I need multiply this matrix with vector that also has variable. How can I do that? fox example [ 1-q0 -0.5q1c -0.5q1s; -q1c 1-q0 0;q1s 0 1-q0]*[vc0;vc1;vc2]
q0,q1c,q1s,-q1c,vc0;vc1;vc2 are variables
0 commentaires
Réponses (1)
Akhilesh Mishra
le 11 Juil 2017
I am not sure of what do you mean by simulating a matrix in Simulink. If you just want to multiply the matrix with a vector having variables, it can be done in the MATLAB command window by entering the following commands-
>> syms q0 q1c q1s vc0 vc1 vc2
>> [ 1 - q0 -0.5*q1c -0.5*q1s; -q1c 1 - q0 0;q1s 0 1 - q0]*[vc0;vc1;vc2]
ans =
- (q1c*vc1)/2 - (q1s*vc2)/2 - vc0*(q0 - 1)
- q1c*vc0 - vc1*(q0 - 1)
q1s*vc0 - vc2*(q0 - 1)
The resulting answer is a 3x1 vector as expected. Please note the 'syms' command is a function of Symbolic Math Toolbox, details provided in the link below -
0 commentaires
Voir également
Catégories
En savoir plus sur Symbolic Math Toolbox dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!