setting parameters for 4 Blocks (wrong number of input arguments, should be odd?)
조회 수: 6 (최근 30일)
이전 댓글 표시
Hello,
when i set the Parameters for 1 Block i dont have any Problems( 3 input arguments )
But as soon as i want to do it for 4 i get an error message
set_param('model/Transfer Fcn','Denominator','T11','model/Transfer Fcn1','Denominator','T12','model/Transfer Fcn2','Denominator','T21','model/Transfer Fcn3','Denominator','T22');
Wrong number (12) of input arguments detected
At least 3 arguments are needed for set_param.
The number of arguments should be an odd value.
that doesnt make any sense to me , since there are 3 input arguments for every Block.
why do i get an error and how can i solve it ?
thanks in advance and
Kind regards,
Bünyamin
댓글 수: 0
채택된 답변
Rollin Baker
2017년 4월 13일
Hi Bünyamin,
The reason you are seeing this error is because the 'set_param' function is only meant to be called on a single block at a time. You will need to call it on each block individually. For example:
set_param('model/Transfer Fcn','Denominator','T11');
set_param('model/Transfer Fcn1','Denominator', 'T12');
set_param('model/Transfer Fcn2','Denominator','T21');
set_param('model/Transfer Fcn3','Denominator','T22');
This will give you the behavior you want without any errors. If you want to learn more about the 'set_param' function, check out the documentation page below:
I hope this helps. Good luck with your project!
-Rollin
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Model, Block, and Port Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!