ワークスペース上の変数をAppDesignerでプロットする
45 views (last 30 days)
Show older comments
Mamoru Mabuchi
on 28 May 2020
Answered: Kojiro Saito
on 28 May 2020
MATLABワークスペースから、AppDesigerへの変数の受け渡し方法がわかりません。
例えば下記のような変数x,yがMATLABのワークスペース上に定義されているとします。
x=1:10;
y=sin(x);
このAppDesigerでグラフをプロットするにはどのようにすれば良いでしょうか?
0 Comments
Accepted Answer
Kojiro Saito
on 28 May 2020
evalinコマンドでワークスペースから変数を取ってくればできます。
座標軸を(app.UIAxes)をApp Designerの設計ビューに置いて、
以下のようなコマンドをアプリのstartupFcnやボタンのコールバックに入れてみてください。
x = evalin('base','x');
y = evalin('base','y');
plot(app.UIAxes, x, y)
0 Comments
More Answers (0)
See Also
Categories
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!