MATLAB: How to get image data from an axes

axescdataguideimage

Hello.
I want to get the data from an image displayed on an axes using GUIDE. I have searched this forum and found that using the following should work
IM=get(handles.axes1, 'CData');
However i get the following error
Error using hg.axes/get
The name 'CData' is not an accessible property for an instance of class 'axes'.
Error in SingleImageSNR>pushbuttonCentre_Callback (line 1846)
IM=get(handles.axes1, 'CData');

Best Answer

Try getframe()