How to simulate a model dynamically from m-file?

8 ビュー (過去 30 日間)
ARUN Patel
ARUN Patel 2013 年 9 月 4 日
I am calling a model in a loop. but every time model is simulated. I want to simulate model once and change the input to the model dynamically during the simulation. How to do it.
for t=1:1:10
Ax=ax(t); Ay=ay(t); Az=az(t);
P=p(t); Q=q(t); R=r(t);
PSI=psi(t); THETA=theta(t); PHI=phi(t);
U=u(t); V=v(t); W=w(t);
X=x(t); Y=y(t); Z=z(t);
sim('NC_Manas');
end
Thanks in advance....

回答 (2 件)

A Jenkins
A Jenkins 2013 年 9 月 4 日
The "From Workspace" block will take arrays of the form [time value] and step through the values at the time step defined. See examples here:

Kaustubha Govind
Kaustubha Govind 2013 年 9 月 4 日
If you need the MATLAB code to be run continuously and feed inputs to the model, you need to run it in one of the three MATLAB function blocks available, so it runs as part of the model.

カテゴリ

Help Center および File ExchangeModeling についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by