필터 지우기
필터 지우기

GUI, Handles saved in variable

조회 수: 1 (최근 30일)
Michal Demjan
Michal Demjan 2016년 9월 25일
답변: Image Analyst 2016년 9월 25일
well in simple, i wrote:
A=['handles.',get(hObject,'Tag')];
set(A,'Backgroundcolor',[0,1,0]);
or
A='handles.pushbutton1';
set(A,'Backgroundcolor',[0,1,0]);
and function 'set' cannot read that A, can you help me? Uncle MATLAB says :
Error using set
Value must be a handle

채택된 답변

Stephen23
Stephen23 2016년 9월 25일
편집: Stephen23 2016년 9월 25일
Why are you trying to construct a string? If you have a structure, then do this:
A = handles.(get(hObject,'Tag'));
And read this:
  댓글 수: 1
Michal Demjan
Michal Demjan 2016년 9월 25일
Oh i didnt realized that it is struct. Thanks a lot!

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2016년 9월 25일
Try
handles.pushbutton1.BackgroundColor = [0, 1, 0];

카테고리

Help CenterFile Exchange에서 Structures에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by