How to output a vector in MATLAB Function in Simulink?

조회 수: 7 (최근 30일)
Gaetano Trovato
Gaetano Trovato 2022년 10월 23일
댓글: Gaetano Trovato 2022년 10월 24일
I tried to do it this way, but it does not work. How can I fix it?
  댓글 수: 2
Paul
Paul 2022년 10월 23일
Hi Gaetano,
What doesn't work?
As far as I can tell, that code takes in the state variables and outputs their derivatives, which are presumably integrated outside the function.
Also, there is no need to compute Minv explicitly. Instead, that last line could be
[xdot_3,xdot_4] = M_theta \ [same stuff here];
Gaetano Trovato
Gaetano Trovato 2022년 10월 23일
Hi Paul,
Thank you for your reply.
It gives me this error, I cannot understand why.

댓글을 달려면 로그인하십시오.

답변 (1개)

Paul
Paul 2022년 10월 23일
One problem that I should have seen before is that this line
[xdot_3,xdot_4] = Minv * [same stuff here];
should be
temp = M_theta \ [same stuff here];
xdot_3 = temp(1);
xdot_4 = temp(2);
Does that solve all of the problems?

카테고리

Help CenterFile Exchange에서 General Applications에 대해 자세히 알아보기

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by