Simulink - store signal and output as vector

I want to store a signal until time that I will define and than get the values which receive from the signal as vector

2 commentaires

Fangjun Jiang
Fangjun Jiang le 10 Juil 2023
??
Tamar
Tamar le 11 Juil 2023
Let’s say all my running time it’s 10 sec and I want values of signal as vector every 2 sec

Connectez-vous pour commenter.

Réponses (1)

Manas
Manas le 11 Juil 2023

0 votes

Hi Tamar,
You can save data from Simulink to a MAT-file using the To File block. To save it as an array, specify the Save format parameter as Array. Further, you can specify the sample period and offset at which to collect data points using the Sample time parameter.
You can also consider writing the input signal data to a workspace using the To Workspace block, however the data will not be available until the simulation pauses or stops.

1 commentaire

Tamar
Tamar le 11 Juil 2023
Thank you so much!!! If I use ‘to file’, how can I read the data back to the simulink? I can’t use ‘from file’ block because the file has the same name…

Connectez-vous pour commenter.

Question posée :

le 10 Juil 2023

Commenté :

le 11 Juil 2023

Community Treasure Hunt

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

Start Hunting!

Translated by