Extract variables saved to workspace from simulink
10 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
SUHANYA M S
il 18 Ott 2023
Commentato: SUHANYA M S
il 30 Ott 2023
Using the "To Workspace" block, many signals of different sampling time are saved to the workspace as "Structure with time". The results are saved in "simout". As the sampling time is different, the data consists of unequal length, and cannot be appended within a single array. Further, two logging intervals have been used.
I would like to combine the signals of sample rate 100ns, 1us, 15us and 150us so that the data for each logging interval can be retrieved in one go (or I would have to read each array (variable? - not sure of the term to be used)).
The time is stored in "tout" within "simout", and each signal is saved with the name specified in "To Workspace". The same is attached.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1514149/image.png)
Is there a way to access these variables (arrays??) using some simplified method? I'm new to programming and not yet familiar with all the terms.
5 Commenti
Mathieu NOE
il 19 Ott 2023
Modificato: Mathieu NOE
il 19 Ott 2023
sorry to insist but why not resample (in your simulink file) all the data at the simulation sampling rate ? those who runs at slower sampling rate would have multiple values (interpolation) but that doesn't seem to be an issue IMO
Risposta accettata
Fangjun Jiang
il 26 Ott 2023
I would suggest you saving the data in time series format and use API to process it.
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Prepare Model Inputs and Outputs in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!