Expert needed / event function
1 次查看(过去 30 天)
显示 更早的评论
Hey Guys,
is it possible to trigger a fcn when a special command is used ? e.g. Imagine u have got a GUI that gets an Input Array and gives the user the possibility to calculate/Change the Input Array.
Furthermore, imagine the GUI holds an amount of buttons, each representing one calculation type. After the calculation is done, the GUI uses the setappdata() command to make the new Data global for the other buttons.
Question: is it possible to create a fcn that actives it self everytime the command: setappdata is used ?
0 个评论
回答(2 个)
Adam
2014-8-28
You could probably just write a wrapper function for setappdata which calls your fcn function immediately after the call to setappdata.
So instead of calling setappdata directly from multiple places just call
setmyappdata( h, name, val )
(but don't name it that, it's just for example!!)
Then:
function setmyappdata( h, name, val )
setappdata( h, name, val );
fcn( args )
You may need to do some other preparation for your call to fcn or use getappdata or whatever it is you need to obtain any arguments your function requires, but that solution should work if I understand what you are asking correctly.
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!