I have generated a plot like
figure; hold; axis([0 10 0 10]); fill([ 1 1 5 5], [5 1 1 5],\'b\')
and now I want to have this plot as an matr
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);