필터 지우기
필터 지우기

how to extract data from a push button such as color?

조회 수: 1 (최근 30일)
Dany Majed
Dany Majed 2019년 3월 25일
댓글: Dany Majed 2019년 3월 26일
hello,
so i am having mainly two buttons in my gui one button that changes its color every time i press it but i need when i press the second button which is the save button to save the the last color clicked on the first button and and save it in matrix since each color does have a matrix, since in the normal button i used if statements according to number of clicks and this is bellow the command that i used to change a color of a button so i need to know how could i retrieve the information from first button when save button is pressed so that i can save it in a matrix . Thanks in advance.
set(handles.pushbutton65,'BackgroundColor','yellow');

채택된 답변

Walter Roberson
Walter Roberson 2019년 3월 26일
get(handles.pushbutton65, 'BackgroundColor')
you will get an RGB triple rather than a color name.
  댓글 수: 2
Image Analyst
Image Analyst 2019년 3월 26일
Or, in OOP lingo:
BackgroundColor = handles.pushbutton65.BackgroundColor;
You could do similar with any property of the pushbutton, for example String, Position, Enable, Visible, etc.
Dany Majed
Dany Majed 2019년 3월 26일
Thanks appreciate that

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

제품


릴리스

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by