Effacer les filtres
Effacer les filtres

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

3 vues (au cours des 30 derniers jours)
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:

Réponses (0)

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by