Pulling in data exported from the Data Inspector into another model

2 次查看(过去 30 天)
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.

回答(1 个)

Sulaymon Eshkabilov
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 个评论
Thor
Thor 2024-1-8
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).

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by