How to save to mat file sequentially using a loop and simout?

4 visualizaciones (últimos 30 días)
Gustavo Araujo
Gustavo Araujo el 10 de Feb. de 2021
Hi everyone!
I'm getting stuck on a simple part of my code. I have a simulink simulation that exports to Workspace two outputs: Fault and Ir. I'm trying to do a loop to automatically run my simulation and save these outputs. Here's the code:
for i = 1:100
simOut(i) = sim('mymodel');
filename1(i) = 'Fault.mat(i)';
save(filename1)
filename2(i) = 'Ir.mat(i)';
save(filename2)
end
But I'm getting:
Unable to perform assignment because the indices on the left side are not compatible with the size of the right.
How to solve this?
Thank you in advance!

Respuestas (0)

Categorías

Más información sobre Simulink Environment Customization en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by