How to find block Priorities in model using m-script

조회 수: 4 (최근 30일)
gvreddy
gvreddy 2015년 5월 6일
편집: Sebastian Castro 2015년 5월 6일
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?

채택된 답변

Sebastian Castro
Sebastian Castro 2015년 5월 6일
편집: Sebastian Castro 2015년 5월 6일
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
gvreddy
gvreddy 2015년 5월 6일
편집: gvreddy 2015년 5월 6일
Thank you Sebastian. Finally I found same thing..

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Programmatic Model Editing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by