how to find the number of Block outport in a model
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Paul Nanfah
am 9 Mär. 2016
Beantwortet: Sebastian Castro
am 9 Mär. 2016
hi I try to find out the number of Outport involve in a hierachy-level when i do this:
g = get_param(gcb, 'LineHandles')
n = length(a.Outport)
I get the number of outport/outgoing Signals on the selected Block, but i want to have the number for a complete model. For this example:

n = 5
thank you
0 Kommentare
Akzeptierte Antwort
Sebastian Castro
am 9 Mär. 2016
You can use the find_system function to search.
To get all the blocks at your current hierarchy level, for example, you can use the command
blocks = find_system(gcs,'type','block')
Then, each element of the output, e.g., blocks{1}, would replace gcb in your existing code.
Take a look at the find_system documentation. You can do much more complex searches this way!
- Sebastian
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!