How to simulate the matrix in Simulink
2 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Akhilesh Mishra
on 11 Jul 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 Comments
See Also
Categories
Find more on Assumptions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!