How to import matlab file variables in Simulink (By adding some block in Simulink Model)

1 visualización (últimos 30 días)
I have seen in some Simulink Model, there was a block with the M-File. You just double click that file, it gets executed and variables are available for Simulink Model. Can anybody help me to find the way to do it. Thanks

Respuesta aceptada

Fangjun Jiang
Fangjun Jiang el 27 de Oct. de 2011
That is probably a customized mask of a subsystem block. Assume the M-file you want to run is MyParam.m, you can drag an empty subsystem block, right click, select 'block properties', select 'Callbacks' tab, select 'OpenFcn', type in MyParam.
You can even mask it by select the block, press ctrl+M, in the 'Drawing Commands', put in disp('MyParam').

Más respuestas (0)

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by