Working with Apps and classes

4 次查看(过去 30 天)
Paul
Paul 2017-3-9
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
  1 个评论
Astarag Chattopadhyay
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

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile 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!

Translated by