Using variables from other callbacks

11 ビュー (過去 30 日間)
Chinedu Okoye
Chinedu Okoye 2020 年 8 月 5 日
コメント済み: Chinedu Okoye 2020 年 8 月 6 日
Hello,
I'm having issues with calling variables set in my SelectBatteryDataFilesButton callback from my PlotButtonPushed callback. The code is meant to take the data read in and store it in values of X and Y, then plot it once the push button is pressed. Any idea what may be causing the issue? I'm new to app designer and I'm not sure if the set/getappdata is being used correctly.

採用された回答

Mohammad Sami
Mohammad Sami 2020 年 8 月 6 日
You dont have to use setappdata, getappdata in app designer.
You can store the values that you want to be available in your app as public or private properties.
You need to add the properties to your app in the GUI before you use them.
These can then be accessed in your function as follows.
function somefunction(app)
app.Propertyname = 12;
end
function someotherfunction(app)
disp(app.Propertyname);
end
  2 件のコメント
Mohammad Sami
Mohammad Sami 2020 年 8 月 6 日
Chinedu Okoye
Chinedu Okoye 2020 年 8 月 6 日
Thank you! This works perfectly.

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

その他の回答 (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