Transfer of Fcn Block between Simulink and MATLAB
Mostrar comentarios más antiguos
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.
Respuesta aceptada
Más respuestas (1)
Rostyk Spolyak
el 19 de Oct. de 2011
0 votos
4 comentarios
Kaustubha Govind
el 19 de Oct. de 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
el 24 de Oct. de 2011
Kaustubha Govind
el 24 de Oct. de 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
el 24 de Oct. de 2011
Categorías
Más información sobre Programmatic Model Editing en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!