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

采纳的回答

Kevin Holly
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 个评论
Stuart Smith
Stuart Smith 2022-10-18
This worked. Thanks! I still have a question about how to get answers to questions like this about App Designer on my own. Is there a manual or comprehensive tutorial?

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Develop Apps Using App Designer 的更多信息

产品


版本

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by