How to add a property to the handles?
조회 수: 6 (최근 30일)
이전 댓글 표시
I'm creating GUI using guide. I added a new handles, but it does not contain any property (like struct). Please advice.
댓글 수: 0
채택된 답변
Arthur
2012년 7월 10일
So your code is:
handles.edit1 = 0;
This way you don't create an object, you simply add a field to the structure "handles", with value 0. I think you misunderstand the concept of handles. A handle is merely a number to refer to an object. The handle itself does not contain any properties. In addition, you can't add properties to an object: all properties are defined by the type of object.
Maybe you want to look at some of these examples: http://www.youtube.com/watch?v=D_hmws6dwgg http://www.mathworks.com/matlabcentral/fileexchange/7598
댓글 수: 0
추가 답변 (3개)
Luffy
2012년 7월 10일
Let me explain it for an edit box(assuming Tag is 1)
x = get(handles.edit1,'String');
set(handles.edit1,'String',z);
Now similarly use get & set to get & set properties via handles of Objects
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!