How to run a matlab function using a button pushed in AppDesigner
古いコメントを表示
Hello everyone,
My question is simple. I want to run a function in matlab base workspace using a button pushed in AppDesigner.
I added a button in my app, and create a callback with this instruction :
run ('Path of my function');
My function is (just for the test) :
function r=addition(a,b)
r=a+b;
end
Thank you in advance.
6 件のコメント
Jan
2021 年 7 月 19 日
This function has 2 inputs. Hwich inputs do you provide when you define the callback?
Myssipsa Mehraz
2021 年 7 月 19 日
@Myssipsa Mehraz There's no reason the callback code you've posted wouldn't work. It's just an unnecessarily awkward style of programming.
Myssipsa Mehraz
2021 年 7 月 21 日
編集済み: Myssipsa Mehraz
2021 年 7 月 21 日
Jan
2021 年 7 月 21 日
Using assignin to create variables in the base workspace and calling a script is a shot in your knee. Convert the script into a function and provide the variables as input arguments. Then it is very easy to call your function from inside the callback of a GUI.
Myssipsa Mehraz
2021 年 7 月 22 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File 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!


