how to plot directly from value in app designer?

1 回表示 (過去 30 日間)
syuhada
syuhada 2024 年 4 月 27 日
コメント済み: Voss 2024 年 5 月 13 日
i am not very familiar with app designer. i want to make a calculator like above, while plotting graph from values from insulin concentration as y-axis and time as x-axis.do i need to tabulate the values then plot or i can straight away plot from the values?

採用された回答

Voss
Voss 2024 年 4 月 27 日
編集済み: Voss 2024 年 4 月 27 日
Assuming those are numeric edit fields called "InsEdit1", "InsEdit2", ..., and "TimeEdit1", "TimeEdit2", ..., then here's one way to plot the entered values:
c = [app.InsEdit1.Value app.InsEdit2.Value app.InsEdit3.Value]; % etc.
x = [app.TimeEdit1.Value app.TimeEdit2.Value app.TimeEdit3.Value]; % etc.
plot(x,c)
The plot will be in the current axes, which is most likely an axes in a figure outside your app's uifigure. If you want to plot to an axes or uiaxes in your app, create one first in Design View, and then specify its name in the plot call:
plot(app.UIAxes,x,c)
Also, you may be interested in using a uitable to display and edit all those values:
  2 件のコメント
syuhada
syuhada 2024 年 5 月 13 日
移動済み: Voss 2024 年 5 月 13 日
thanks.it worked
Voss
Voss 2024 年 5 月 13 日
You're welcome!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeDevelop Apps Using App Designer についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by