필터 지우기
필터 지우기

How to save Simulink Simulation output and runs it sequentially (creating a database)?

조회 수: 3 (최근 30일)
Hi everyone!
I have a Simulink Simulation that has two blocks To Workspace, exporting two variables: Ir and Fault. How can I create a script that calls my simulink simulation and save these outputs sequentially, like Ir1, Ir2, Fault1, Fault2 and so on.
I tried:
function save = postsim(out);
for i=1:2
Save('Ir','Fault');
end
end
and:
in = Simulink.SimulationInput('MyModelName');
in = in.setPostSimFcn(@(Fault) save(Fault));
in = in.setPostSimFcn(@(Ir) save(Ir));
in = in.setModelParameter('SaveOutput','on');
out = sim(in);
And I get:

답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by