How to check/map simulink data set is matching model's inports programmatically?

3 ビュー (過去 30 日間)
Andy
Andy 2024 年 1 月 18 日
編集済み: Andy 2024 年 9 月 11 日
I have some simulink dataset stored in a lot of mat files.
Is there a way to check those dataset is still matching the model's inports?
I know I can probably use Root Inport Mapper to check it manually, but I would like to know how to do that programmatically.
Thanks
  2 件のコメント
Selena Mastrodonato
Selena Mastrodonato 2024 年 1 月 19 日
I don't know if there is a way to do it programmatically, but if you have all of your datasets loaded in the workspace, you can link them all together in Root Inport Mapper and check the mapping to model.
Andy
Andy 2024 年 1 月 22 日
Yea but I would still like to know how to do it programmatically

サインインしてコメントする。

回答 (1 件)

Divyanshu
Divyanshu 2024 年 1 月 30 日
Hi Andy,
A possible way of matching the data coming to inports with data present in the mat files programmatically is by making use of 'To Workspace' block of Simulink. Please go through the following steps:
  • Insert a 'To Workspace' block in the model.
  • Now branch the signal coming out of inport block and input the signal to 'To Workspace' block.
  • In the block parameters dialog box of 'To Workspace' block specify the name of the variable and format in which you want to save the data.
  • Later you can compare the dataset file and the data logged through 'To Workspace' Block.
Refer the following documentation for further details about 'To Workspace' block:
Hope it helps!
  3 件のコメント
Divyanshu
Divyanshu 2024 年 2 月 2 日
編集済み: Divyanshu 2024 年 2 月 2 日
Yes I understood, 'To Workspace' Block is capable of creating a Timeseries type of array, which would have the input values to the model along with Timestamps of simulation.
A Simple MATLAB script which iteratively compares the data present in 'MAT' file and the Time-series data logged in Base workspace by 'To Workspace' Block would be a possible workaround to match the data programmatically, if you do not want to use 'Root Inport Mapper'.
Andy
Andy 2024 年 2 月 5 日
編集済み: Andy 2024 年 2 月 5 日
I see what you mean, but editing the model is just not an option to me.
It could be a good answer for other people for sure. Thanks.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeInteractive Model Editing についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by