link to a m-file from Simulink model
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Hi,
How can I place a box with the link to a m-file into a Simulink model like those of S-function examples ?
Thanks
4 comentarios
Fangjun Jiang
el 25 de Sept. de 2011
What do you mean "link"? What do you try to do? There is a way to run a .m file when you double-click a block in the Simulink model. But that is not the case for sfundemos.mdl. It's just a library with subsystem hierarchy.
Faisal Ahmed
el 6 de Sept. de 2017
Hello can you please tell me how can i run .m file when i double clicl a simulink model.
Respuestas (1)
Kaustubha Govind
el 26 de Sept. de 2011
I think the links in the S-function demos are basically empty subsystems with the OpenFcn block callback defined so as to open the corresponding MATLAB file. You can drag a Subsystem block, delete its contents so the input/output ports disappear. Then right-click on the block, select "Block Properties" and under the Callbacks->OpenFcn pane, enter "edit mymatlabfile.m". This should do the trick.
The other technique as Alessandro mentioned is to create an annotation and define it's ClickFcn as "edit mymatlabfile.m".
Ver también
Categorías
Más información sobre Interactive Model Editing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!