How to clear MATLAB Workspace directly through App designer

2 ビュー (過去 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 Center および File ExchangeDevelop 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