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

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

Respuesta aceptada

Kojiro Saito
Kojiro Saito el 28 de Mayo de 2020
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 Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!