ワークスペース上の変​数をAppDesig​nerでプロットする

MATLABワークスペースから、AppDesigerへの変数の受け渡し方法がわかりません。
例えば下記のような変数x,yがMATLABのワークスペース上に定義されているとします。
x=1:10;
y=sin(x);
このAppDesigerでグラフをプロットするにはどのようにすれば良いでしょうか?

 Respuesta aceptada

Kojiro Saito
Kojiro Saito el 28 de Mayo de 2020

2 votos

evalinコマンドでワークスペースから変数を取ってくればできます。
座標軸を(app.UIAxes)をApp Designerの設計ビューに置いて、
以下のようなコマンドをアプリのstartupFcnやボタンのコールバックに入れてみてください。
x = evalin('base','x');
y = evalin('base','y');
plot(app.UIAxes, x, y)

Más respuestas (0)

Categorías

Más información sobre App Designer を使用したアプリ開発 en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 28 de Mayo de 2020

Respondida:

el 28 de Mayo de 2020

Community Treasure Hunt

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

Start Hunting!