Search for all the Divide block in a subsystem and its children
2 ビュー (過去 30 日間)
古いコメントを表示
Hello,
I am trying to find for all the Divide blocks in a model subsystem (and its children) but with no success. Here is the code that I use
Global_path = 'MyModel/MySubsystem';
blks = find_system(Global_path,'BlockType','Divide');
but with no success. On the other hand, as I think that Divide block is basically a Product block, I use this syntax instead:
Global_path = 'MyModel/MySubsystem';
blks = find_system(Global_path,'BlockType','Product','Inputs', '*/');
The latter code seems to work a bit better. However, I have two questions:
1. Are we sure that I am searching only in 'MyModel/MySubsystem'? I DON'T want to search in any other submodel, i.e. 'MyModel/AnotherSubsystem' shall be exluded
2. This method is not very robust as it search only blocks that has exactly '*/' as input. If I have a block that instead would have '**/' will be excluded. How can I robustify my code? For example by searching for all the blocks that CONTAIN the string '/'?
Many thanks!
0 件のコメント
回答 (1 件)
Sharan Paramasivam Murugesan
2017 年 8 月 22 日
1. Yes, find_system function will search only under the system you specify.
2. Use the option "RegExp" with value "on" i.e., blks = find_system(Global_path,'RegExp','on','BlockType','Product','Inputs','/')
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で General Applications についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!