フィルターのクリア

How can a Script Read a resolved Data Type String?

1 回表示 (過去 30 日間)
Jeremy
Jeremy 2013 年 10 月 11 日
回答済み: Aditya 2016 年 7 月 27 日
I need to have my m-script read the data types of several blocks and labeled signals in a Simulink model, immediately after the model has been run. Many of these data types are not available in the "OutDataTypeStr" property. For example, I see one inport whose "OutDataTypeStr" value is set to "inherit: auto", but because I selected "Format - Port/Signal Displays - Port Data Types", when I run the model I see the correct name of the custom data type apear above the inport block's output signal. I can see it on my screen, but I cannot figure out how to read it in an M-script. Any suggestions?

回答 (1 件)

Aditya
Aditya 2016 年 7 月 27 日
You need to be in compiled mode for this.
Say your full block path is stored in the variable blockPath Note: The full block path can be obtained using the command gcb after a block is selected in the Simulink model.
>> blockObject = get_param(blockPath, 'Object');
>> blockObject.CompiledPortDataTypes % will give you what you want

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by