Why can't I remove reference to simulink in app?
Mostrar comentarios más antiguos
I accidently added a Simulink component to my app. I removed the component, but I can't remove the refernece to Simulink.
Why do these 4 lines persist when there is no model? Why isn't there an option to remove Simulink in App Designer? I really don't want to recreate my entire projct.
% Public properties that correspond to the Simulink model
properties (Access = public, Transient)
Simulation simulink.Simulation
end
Respuesta aceptada
Más respuestas (2)
SACHIN KHANDELWAL
el 21 de Abr. de 2025
0 votos
I was able to reproduce the issue on my end.
After removing the Simulink components, I could still see those four lines in the MATLAB App Designer code.
A possible workaround in this case is to export the code to a .m file and recreate the MATLAB app. From the 'Designer' tab of your app, go to Save → Export to .m file.
By doing this, you can modify the .m code and remove the unwanted lines.
I hope this workaround helps resolve the issue.
Snehal
el 21 de Abr. de 2025
0 votos
When a Simulink component is added to the design view in App Designer, some additional lines of code are added in the corresponding code viewer. Deleting the Simulink component results in deletion of only some of these code lines, not all.
Since these persistent lines of code cannot be manually deleted from the code-viewer directly, possible workaround could be to export this code as a .m file and then edit this newly saved code file in the MATLAB Editor.
Please follow the steps given below to implement the same:
- Go to ‘Designer’ tab of your app
- Save -> Export to .m file
- Open the exported .m file in MATLAB Editor
- You can edit this newly created file in the Editor
- Click the ‘Run’ button from toolstrip to launch the app directly
For more information please refer to the following MATLAB community discussion:
Hope this helps.
Categorías
Más información sobre Simulink en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!