Hi
I tried making a timer callback function on app designer like this, but it didn't work. What is the problem?
function Test(obj,event,app,variable)
disp(variable);
disp(app.something);
end
tt = timer('Name','Test','Period',1,'ExecutionMode','fixedSpacing','BusyMode','drop');
tt.TimerFcn = {@app.Test,app,10};
start(tt);

댓글 수: 1

Where is your function located?
Try removing the app. before Test?
tt.TimerFcn = {@Test,app,10};

댓글을 달려면 로그인하십시오.

 채택된 답변

Jan
Jan 2022년 6월 24일

0 개 추천

app.something = 'hello';
tt = timer('Name','Test','Period',1, ...
'ExecutionMode','fixedSpacing','BusyMode','drop');
tt.TimerFcn = {@Test, app, 10}; % 1st two inputs inserted automatically
start(tt);
function Test(obj, event, app, variable)
disp(variable);
disp(app.something);
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Develop Apps Using App Designer에 대해 자세히 알아보기

질문:

2022년 6월 24일

답변:

Jan
2022년 6월 24일

Community Treasure Hunt

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

Start Hunting!

Translated by