MATLAB: Hide image in GUI using visible on/off

imageimage processingMATLABmatlab guivisibility

I am trying to change the visibility of an image through the following commands:
set(handles.axes1,'visible','off') %hide the current axes

set(get(handles.axes1,'children'),'visible','off') %hide the current axes contents
However, an error is generated since it does not recognize the axes:
Reference to non-existent field 'axes1'.
Error in VibrationModel>MechSeal_Callback (line 82)
set(handles.axes1,'visible','off') %hide the current axes
The create function for the image is given by:
% --- Executes during object creation, after setting all properties.
function axes1_CreateFcn(hObject, eventdata, handles)
LipSeal=imread('Lip-Seal.jpg');
imagesc(LipSeal);
axis off; %remove axis from image

Best Answer

I never put anything in the create function.
In your MechSeal_Callback function put this line:
handles
Tell us what it spits out to the command window. Paste it back here.
Related Question