Transfer of Fcn Block between Simulink and MATLAB
Ältere Kommentare anzeigen
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.
Akzeptierte Antwort
Weitere Antworten (1)
Rostyk Spolyak
am 19 Okt. 2011
0 Stimmen
4 Kommentare
Kaustubha Govind
am 19 Okt. 2011
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
am 24 Okt. 2011
Kaustubha Govind
am 24 Okt. 2011
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
am 24 Okt. 2011
Kategorien
Mehr zu Programmatic Model Editing finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!