How to search for a specific outport data type when set to Inherited ?
8 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposte (1)
Kaustubha Govind
il 24 Mag 2013
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')
0 Commenti
Vedere anche
Categorie
Scopri di più su Model, Block, and Port Callbacks in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!