How can I use Matlab command line to open/close signal viewer interfaces in Simulink 7.8 (R2011b)?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
MathWorks Support Team
el 12 de Dic. de 2011
Comentada: Cory Dinkle
el 20 de Dic. de 2021
I have a signal viewer attached to a signal line in my Simulink model. I want to open and close this signal viewer through MATLAB command line interface. I do not want to interact with the Simulink interface by double clicking on its symbol on the model. I have subsystems in my model and the signal viewer could be attached to any level in the model.
Respuesta aceptada
MathWorks Support Team
el 12 de Dic. de 2011
Consider the model 'testMdl.mdl'. There is a viewer named "MyViewer" in the top layer of the model and there is another viewer named 'ViewerInSubsystem' inside the subsystem. I can open and close these viewers from MATLAB command line using the following code:
>> mdl = 'testMdl';
>> open_system(mdl);
>> set_param( [mdl '/MyViewer'],'open','on');
>> set_param( [mdl '/ViewerInSubsystem'],'open','on');
>> set_param( [mdl '/MyViewer'],'open','off');
>> set_param( [mdl '/ViewerInSubsystem'],'open','off');
However deep the signal viewer is in the model, they can always be accessed programmatically by specifying the model name and the signal viewer name. It is not necessary to point to the location where the viewer exists in the model.
1 comentario
Cory Dinkle
el 20 de Dic. de 2021
How is this done in 2021b? When using this command, nothing happens.
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!