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!