Working with Apps and classes

조회 수: 2 (최근 30일)
Paul
Paul 2017년 3월 9일
댓글: Astarag Chattopadhyay 2017년 3월 14일
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
Astarag Chattopadhyay 2017년 3월 14일
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에서 App Building에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by