How to output a vector in MATLAB Function in Simulink?

10 次查看(过去 30 天)
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 中查找有关 Multicore Processor Targets 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by