Are you aware of the callbacks that are used to accomplish any action when an event occurs? Like in this case you can associate a callback with your push button and add your piece of code in the corresponding callback function. You can refer to this link for more details about callbacks: https://www.mathworks.com/help/matlab/creating_guis/app-designer-callbacks.html
Working with Apps and classes
3 次查看(过去 30 天)
显示 更早的评论
Hi,
I have recently discovered the Matlab APP and love it. However I'm not very good at Object Orientated Programming (OOP) yet so I was looking for some help with dealing with some legacy code.
I would like to use a push button in the App to call an object in the workspace. But I'm not entirely sure how to to it with the syntax and abilities of OOP in Matlab.
So my Legacy code calls a property of an ojbect and querys it.
e.g
if true
% code
x=function1(Instance.Property,string,b,c)
query(Instance.Property,'string')
x=b+c
end
end
I have a push button call in the app set out like this:
if true
% code
methods (Access = private)
function Buttonpress1(app, event)
end
end
end
I only have on instance of the class if that helps?
Thanks for any help!
Paul
回答(0 个)
另请参阅
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!