필터 지우기
필터 지우기

Using variables from other callbacks

조회 수: 33 (최근 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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Develop 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