Saving Multiple Values in a single time step in Simulink.

3 Ansichten (letzte 30 Tage)
Hammad
Hammad am 11 Mai 2020
Kommentiert: Mehmed Saad am 11 Mai 2020
I need to run simulation for 1 second.
Sampling time is 0.1 second, So, there are 10 time steps in total.
I have a for-iterator in my model, it iterates from 1:5. therefore, in a single time-step it outputs i=1,i=2,i=3,i=4,i=5.
I neend to save the results of my model at i=1, i=2 i=3, i=4 and i=5 in every time instant.
So, there will be 50 values to be saved.
Is there any way to achieve this?
currently, I can use 'to workspace block" but it only saves values at i=5 in each time step.

Akzeptierte Antwort

Mehmed Saad
Mehmed Saad am 11 Mai 2020
Bearbeitet: Mehmed Saad am 11 Mai 2020
store all the values you have in for loop in an array and save that array using to workspace block
see the example project
  2 Kommentare
Hammad
Hammad am 11 Mai 2020
This model seems to be of simulink version 2019a, I am not able to open it in 2018b.
Mehmed Saad
Mehmed Saad am 11 Mai 2020
see the updated attachment

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Modeling finden Sie in Help Center und File Exchange

Produkte


Version

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by