How can a Script Read a resolved Data Type String?
1 回表示 (過去 30 日間)
古いコメントを表示
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?
0 件のコメント
回答 (1 件)
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
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Model Editing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!