Transfer of Fcn Block between Simulink and MATLAB
古いコメントを表示
Hi, everyone. Before simulation I need to transmit to my Simulink model each time different function which is located in Fcn block. Of course I can pass variables to Fcn block but it is not sufficient. Thanks for your help.
採用された回答
その他の回答 (1 件)
Rostyk Spolyak
2011 年 10 月 19 日
0 投票
4 件のコメント
Kaustubha Govind
2011 年 10 月 19 日
Rostyk: set_param works with models AND blocks. See my answer for how I specify the full path to the block to set the parameter.
Rostyk Spolyak
2011 年 10 月 24 日
Kaustubha Govind
2011 年 10 月 24 日
set_param cannot handle a cell array of block paths (although get_param can). But it's fairly trivial to loop through the array:
bh = find_system('mymodel', 'BlockType', 'Fcn');
for i = 1:numel(bh), set_param(bh{i}, 'Expression', 'u*128+5'), end
Rostyk Spolyak
2011 年 10 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Programmatic Model Editing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!