set property of graphicsobject in array before R2014b
조회 수: 1 (최근 30일)
이전 댓글 표시
I have want to make my GUI compatible <R2014b (see https://de.mathworks.com/help/matlab/graphics_transition/graphics-handles-are-now-objects-not-doubles.html) Specifically, my question is how to write the following using set(object,value) since "." (dot) notation is not allowed...
handles.panel.children(4).position(3) = some value
댓글 수: 0
채택된 답변
Jan
2017년 11월 30일
편집: Jan
2017년 11월 30일
pos = get(handles.panel.children(4), 'Position');
pos(3) = some value;
set(handles.panel.children(4), 'Position', pos);
댓글 수: 3
Jan
2017년 12월 1일
As you can imagine, I do not know what is stored in "handles.panel". If this is a handles of a uipanel, you can apply the method I have showed you already instead of waiting, that someone else does it for you.
children = get(handles.panel, 'Children');
pos = get(children(4), 'Position');
pos(3) = some value;
set(children(4), 'Position', pos);
Do you see, how the dot-notation and get/set are related?
H.Prop = Value
% is equivalent to:
set(H, 'Prop', Value);
Value = H.Prop;
% is equivalent to
Value = get(H, 'Prop');
추가 답변 (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!