How to save Simulink Simulation output and runs it sequentially (creating a database)?
1 次查看(过去 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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!