How to find block Priorities in model using m-script

Hello,
I would like find block priorities in complete model. I tried to find like below code
allblocks = find_system(bdroot(gcs));
for k=1: length(allblocks)
eachBlock=allblocks{k};
Priorities= get_param(eachBlock,'Priority');
end
When I run this code I am getting below error: "Parameter 'Priority' is ignored when 'SolverType' is variable-step"
Please, could someone help me on this?

 Accepted Answer

Looks like this only happens when that eachBlock variable is referring to a model (and not an individual block).
You can filter your search to include only blocks, and not models. Also, you could remove the for-loop since you can pass in a cell array of block names into get_param. Try this:
blocks = find_system(bdroot,'Type','Block');
priorities = get_param(blocks,'Priority');
- Sebastian

1 Comment

N/A
N/A on 6 May 2015
Edited: N/A on 6 May 2015
Thank you Sebastian. Finally I found same thing..

Sign in to comment.

More Answers (0)

Categories

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!