how to extract data from a push button such as color?
2 次查看(过去 30 天)
显示 更早的评论
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');
0 个评论
采纳的回答
Walter Roberson
2019-3-26
get(handles.pushbutton65, 'BackgroundColor')
you will get an RGB triple rather than a color name.
2 个评论
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.
更多回答(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!