Why can't I remove reference to simulink in app?

조회 수: 18 (최근 30일)
Dan
Dan 2025년 4월 18일
편집: Walter Roberson 2025년 4월 22일
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

채택된 답변

Ranjani
Ranjani 2025년 4월 22일
Hi Dan,
This issue has been addressed and will be fixed in a future release. In the meantime, as a temporary workaround, you may use the attached p-coded script (From the zip) to resolve the issue. Provide your mlapp to the function "convertSimulinkAppToStandardApp" and this should remove the Simulink reference.
Please note: This workaround is provided as-is and should be used at your own risk. We advise you to create a backup copy of your app before applying the script.

추가 답변 (2개)

SACHIN KHANDELWAL
SACHIN KHANDELWAL 2025년 4월 21일
Hi @Dan,
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
Snehal 2025년 4월 21일
Hello @Dan,
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:
  1. Go to ‘Designer’ tab of your app
  2. Save -> Export to .m file
  3. Open the exported .m file in MATLAB Editor
  4. You can edit this newly created file in the Editor
  5. 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.

카테고리

Help CenterFile Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by