Effacer les filtres
Effacer les filtres

Pulling in data exported from the Data Inspector into another model

2 vues (au cours des 30 derniers jours)
Thor
Thor le 8 Jan 2024
Commenté : Thor le 8 Jan 2024
I am trying to export a set of signals as Timeseries data using the Simulation Data Inpector (Matlab R2017b) to be used as an input to a Simulink model running R2022b. My current solution is to save it as a .mat file. I then want to use this data as an input for the model that I have updated to Matlab R2022b. I have tried using the 'signal editor block' to bring them in from the .mat loaded into the workspace, but that triggers the data incorrectly. I have tried using the 'from file' and 'from workspace' blocks but the .mat data saved from the Simulation Data Inspector has other data besides the signals and timeseries data. I know I could write a script to remove the unwanted data then use the 'from workspace' block, but I wanted to know if there is a quicker way to do this with the data as formated.

Réponses (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov le 8 Jan 2024
There are a few options that can be used to store simulation data from a Simulink model:
(1) [To File] to store data in .mat file: Timeseries or Array
(2) [To Workspace] and data type can be specified: Timeseries (by default), Array, Structure time series, Structure or Array
(3) [Scope]: Configuration Properties --> Logging --> Log data to workspace: Dataset, Structure time series, Structure or Array
You can choose which one best suits for your model.
  1 commentaire
Thor
Thor le 8 Jan 2024
But I want to take that .mat file (2017b) and import it to another simulink model running Matlab R2022b. Is there an easy way of loading this into the model? Right now I am looking at writing a script to pull out all the TS data from the .mat file then individually loading in the signals one at a time. (There are around 100 signals).

Connectez-vous pour commenter.

Catégories

En savoir plus sur Programmatic Model Editing dans Help Center et File Exchange

Produits


Version

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by