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 matrix so that I can i.e. filter the blog with a gaussian. Googleing I found this thread Rasterizing Plot to Image at MATLAB Central. I tried it, but I could only get it to work for line or function plots.
Do you have any ideas?
What are the desired characteristics of your target matrix ? And what sort of images do you want to rasterise ?
You see, for the only example you have given us it's almost trivial to define a matrix representing your image ...
Your matrix is a raster to start with. Now, you can use the built-in function image to visualise your matrix. Have a look at the documentation for that function. And note that my suggestion does not meet the spec for use with image() and colormap().
You can use GETFRAME function. It returns movie frame structure, which is actually rasterized figure. Field cdata will contain your matrix.