How to find MATLAB function blocks??
5 views (last 30 days)
Show older comments
Dear Community, can i get the answer to this question?
S = sfroot();
% Get block
handlesB = find(sfroot, '-isa','Stateflow.EMChart');
This is the instruction I have used to find out the MATLAB Function blocks. But, this instruction also considers the MATLAB Function block present the the Simulink library. I would like to know whether there is any other command to find out MATLAB Function blocks which are just present in my created Model.
0 Comments
Answers (1)
Yongjian Feng
on 5 Jul 2021
Once you find the root of state flow using sfroot, you can use the find function as you used above. In addtion you can add a new name-value pair if you know the name of the block.
Something like
find(sfroot, '-isa', 'Stateflow.EMChart', 'Name', 'MyBlock');
See Also
Categories
Find more on Simulink Functions in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!