How to clear MATLAB Workspace directly through App designer

조회 수: 7 (최근 30일)
Farzam Malmir
Farzam Malmir 2018년 5월 29일
댓글: Liv Nikolich 2023년 10월 6일
Hi,
I have designed a GUI that successfully runs a Simulink model and then load the post processing results into App designer. However, after the first simulation, if I want to change the parameters in the GUI and the run it again, I face error due to a couple parameters in the MATLAB Workspace that conflict with the new variables. Therefore, the Workspace has to be erased before the second simulation. As "clear command" doesn't work when it's recalled through App designer, I want to know what else I can use to resolve the problem.
Thanks in advance.

채택된 답변

Farzam Malmir
Farzam Malmir 2018년 5월 30일
The problem solved by creating a Simulink file which simply contains a callback function to clear the workspace. Then I added a code to recall this model at the end of my run script to erase everything before the next run.
  댓글 수: 1
Liv Nikolich
Liv Nikolich 2023년 10월 6일
Hello! I'm having the same problem mentioned above. Can you share your code to fix the problem? Thank you!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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