views:

60

answers:

1

Hi! Just imagine you plot several dots, circles, lines in a figure. Afterwards another m file should use this plot as an input to do e.g. thresholding. I'm aware of the print command but I don't want the plot to be stored as file. I would prefer to store it in a matrix (x_dim,y_dim,3). Any ideas?

+1  A: 

You should check out the functions GETFRAME and FRAME2IM to convert a figure or axes object to an image matrix.

gnovice
Josef St.
@Josef St.: The function GETFRAME captures what you see on the screen in the figure window. If you plot an image (using, say, the IMAGE command), then the image may be scaled down to fit the figure window, and when the figure window is captured by GETFRAME you end up with a smaller image than before. You should check out these related SO questions: http://stackoverflow.com/questions/1848176/how-do-i-save-a-plotted-image-and-maintain-the-original-image-size-in-matlab, http://stackoverflow.com/questions/575475/how-can-i-save-an-altered-image-in-matlab
gnovice

related questions