Just have all three checkbox callbacks call the same function: CheckBoxChecked. Then in that function, clear everything and just plot the data you need to.
function checkbox1_Callback(hObject, eventdata, handles)
CheckBoxChecked(handles);
function checkbox2_Callback(hObject, eventdata, handles)
CheckBoxChecked(handles);
function checkbox3_Callback(hObject, eventdata, handles)
CheckBoxChecked(handles);
function CheckBoxChecked(handles)
cla('reset');
state1 = get(handles.checkbox1, 'value');
state2 = get(handles.checkbox2, 'value');
state3 = get(handles.checkbox3, 'value');
if state1
end
if state2
end
if state3
end
Best Answer