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!