MATLAB: Radio button to ON-OFF figure visibility

radio

Hello All, I have been working on GUI. Now I am stuck with one requirement, which is to have a radio button to ON-OFF the image visibility. I have the "Calculate" push button which will calculate in user defined loops where I have 3 images per loop. Every time the script runs the image pops up. If the loops are huge in number the calculation process takes more time. So I want to have a radio button so that when selected the images will popup meaning visibility will be ON while unselected, the figures will not pop up so the user can minimize the GUI and work on something else till a message pops up as calculation is completed. I take user defined location to save the images so user will get to the images whenever he wants.
I tried with figure('Visible','off') and it worked well so I just want to add it with a radio button to give user the choice to ON-OFF images.

Best Answer

Thank you all for your help. I managed to Solve it using
if get(handles.checkbox2, 'Value')
Visibility = 'on';
else
Visibility = 'off';
end
figure('Visible', Visibility)