Pulling in data exported from the Data Inspector into another model

1 view (last 30 days)
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.

Answers (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov on 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 Comment
Thor
Thor on 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).

Sign in to comment.

Products


Release

R2022b

Community Treasure Hunt

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

Start Hunting!