Saving Scope Data after each iterations

8 vues (au cours des 30 derniers jours)
Sugar Mummy
Sugar Mummy le 3 Jan 2022
Hello, I am facing a problem where I have to save Scope data having multiple variables. I am using the code shown below but its not working for me as I want to save the data after every iteration. How can I do that?
Any help would be greatly appreciated. Thanks!
for i =1:numel(All_IR)
IR=All_IR(i)
simOut=sim('ModelName.slx')
save('dataset.mat',i)
end

Réponses (1)

Manish
Manish le 9 Oct 2024
Hi,
I understand that you would like to save the scope data (output) from each iteration to a MAT file.
To achieve this, you can use the 'To File' block in Simulink. Connect all the required signals to the 'To File' block, and when you simulate the model, the results will be stored in a MAT file.
Here is the documentation link for 'To File' block:
Hope this helps!

Catégories

En savoir plus sur Simulink Functions 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