How to search for a specific outport data type when set to Inherited ?
古いコメントを表示
Hi,
In my model, my Output data type are set to inherit. When i update diagram (ctrl + D), simulink display the data type.
I want to search for a specific data type into my entire model.
For exemple, how can i get all the "double" type that exists in my model without staying hours and hours looking into my model ?
Thx
回答 (1 件)
Kaustubha Govind
2013 年 5 月 24 日
I think you should be able to do this using the Simulink command-line API in a MATLAB script. You can use the following commands to get the full list of blocks in your model:
>> blockList = find_system('vdp', 'LookUnderMasks', 'all', 'type', 'block');
Then, compile your model:
>> vdp([], [], [], 'compile')
You can then loop over the blocks list and look at the compiled port datatypes and do something like this:
portDTs = get_param(blockList{i}, 'CompiledPortDataTypes');
hasDoubleOutput = any(cellfun(@(x)isequal(x, 'double'), portDTs.Outport));
Don't forget to terminate the model at the end:
>> vdp([], [], [], 'term')
カテゴリ
ヘルプ センター および File Exchange で Simulink についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!