How to make a button in AppDesigner launch a matlab script ?

Hello!
I am trying make a button in app designer that will launch a matlab script that I wrote before. I have already created a button, but I don't know how to code this in my ButtonPushed button..
Thanks for helping !

 採用された回答

Mario Malic
Mario Malic 2021 年 3 月 8 日

0 投票

Hello,
See run function.

7 件のコメント

Aurélie B
Aurélie B 2021 年 3 月 8 日
Thank you, it helps a lot!
However, the data that I calculate do not appear in the workspace (I'd like to import these data in app designer after the calculations). do you have any tips for that?
Mario Malic
Mario Malic 2021 年 3 月 8 日
You can:
  • save your workspace (or variables only) and use load function within App Designer
  • convert your script to function that outputs the needed results
Aurélie B
Aurélie B 2021 年 3 月 8 日
Thank you again! I'll try that..
I wanted to try to run the matlab script outside appdesigner, because I feared that it would be very long if I put the script in a function (the app is very very slow on my computer).
Mario Malic
Mario Malic 2021 年 3 月 8 日
I think the timing will be very similar regardless whether the file is a function or a script. App is very slow? What does your app do? Only slowness that might be caused is related to plotting the functions many many times.
Aurélie B
Aurélie B 2021 年 3 月 9 日
It displays images like a movie, so I'm sure that the slowness comes from here. But if the timing is similar, I'll put all the script in a function!
Mario Malic
Mario Malic 2021 年 3 月 9 日
You can try external figure window, as opposed to uifigure (the one that AppDesigner uses). Having two different elements is not so nice estetically, but if you care about performance, then it's fine.
Aurélie B
Aurélie B 2021 年 3 月 9 日
ok thank you so much !

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Parallel Server についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by