How to retrieve intermediate variables from a callback function?
이전 댓글 표시
Hi,
I was working on the app designer in matlab which has 3 buttons. For the first two buttons it prints the entrance time and exit time as sprint variables which are extracted from the clock function once the button is clicked. I want to use the two variables when the clock function is used to subtract them when the third button is clicked.
%Button1 button pushed function
function Button1ButtonPushed(app)
A1 = clock;
fix(A1)
E1 = sprintf('\n%2.0f:%2.0f:%2.0f',A1(4),A1(5),A1(6));
app.Enter1.Value = E1;
end
% Button2 button pushed function
function Button2ButtonPushed(app)
B1 = clock;
fix(B1)
S1 = sprintf('\n%2.0f:%2.0f:%2.0f',B1(4),B1(5),B1(6));
app.Exit1.Value = S1;
end
% Button3 button pushed function
function Button3ButtonPushed(app)
T = etime(B1,A1);
end
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!