if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor',[.9 .9 .9]);
tf = isequal(A,B) %如果 A 和 B 等价,则 tf = isequal(A,B) 返回逻辑值 1 (true);否则,返回逻辑值 0 (false)。
Matlab GUI设置背景色:
get(hObject,'BackgroundColor') %获取对象hObject的颜色属性
get(0,'defaultUicontrolBackgroundColor') %默认背景色
if isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor')) %如果两者相等
set(hObject,'BackgroundColor',[.9 .9 .9]); %将hObject的背景色设置为RGB=[.9 .9 .9](是某种灰色吧)