- Before running the Simulink model, run the .m file to save the variables in the workspace and access those variables using ‘From Workspace’ block in Simulink.
- In order to run your m-file automatically when you run your Simulink model, add the m-file name to the ‘InitFcn’ callback in ‘Model Properties->Callbacks’ and use those variables in the Simulink model.
For a problem of Amplitude Modulation, if I want to perform it on Simulink but get the various parameters like carrier freq. etc. from a companion m file, how do I do it ??
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Vincent Abraham
el 23 de Mzo. de 2020
Respondida: Devineni Aslesha
el 26 de Mzo. de 2020
0 comentarios
Respuesta aceptada
Devineni Aslesha
el 26 de Mzo. de 2020
There are two ways to access variables from a .m file to Simulink.
0 comentarios
Más respuestas (0)
Ver también
Categorías
Más información sobre Programmatic 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!