How to simulate the matrix in Simulink

조회 수: 3 (최근 30일)
Mahsen Al-Ani
Mahsen Al-Ani 2017년 7월 6일
답변: Akhilesh Mishra 2017년 7월 11일
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

답변 (1개)

Akhilesh Mishra
Akhilesh Mishra 2017년 7월 11일
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 -

카테고리

Help CenterFile Exchange에서 Symbolic Math Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by