Working with Apps and classes

3 views (last 30 days)
Paul
Paul on 9 Mar 2017
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 Comment
Astarag Chattopadhyay
Astarag Chattopadhyay on 14 Mar 2017
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

Sign in to comment.

Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!