Turn a MATLAB plot into image

You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix.

F=getframe;
figure(2)
imagesc(F.cdata);

Leave a Comment