Within a GUI created with App Designer can I call a function associated with one button inside the code for a different button?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have the code below associated with the EXIT button of my GUI. Can I call this function inside the code for a different button? If so, how?
% Button pushed function: EXITButton
function EXIT(app, event)
if isfile( '_TEMP_.jpg' )
delete( '_TEMP_.jpg' )
end
if isfile( '_PREV_.jpg' )
delete( '_PREV_.jpg' )
end
if isfile( '_CURR_.jpg' )
delete( '_CURR_.jpg' )
end
close all
app.delete
end
댓글 수: 0
채택된 답변
Kevin Holly
2022년 10월 18일
편집: Kevin Holly
2022년 10월 18일
When you create a new function, you can just call that function.
function differentButton(app, event)
EXIT(app)
end
댓글 수: 5
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File 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!