Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!news2.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!newsfe08.iad.POSTED!7564ea0f!not-for-mail
From: Walter Roberson <roberson@hushmail.com>
Organization: Canada Eat The Cookie Foundation
User-Agent: Thunderbird 2.0.0.17 (Windows/20080914)
MIME-Version: 1.0
Newsgroups: comp.soft-sys.matlab
Subject: Re: getimage (IPT) weirdness
References: <gd2nue$2ul$1@fred.mathworks.com>
In-Reply-To: <gd2nue$2ul$1@fred.mathworks.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Lines: 19
Message-ID: <ew5Jk.11$tV.9@newsfe08.iad>
NNTP-Posting-Host: 24.79.146.116
X-Complaints-To: internet.abuse@sjrb.ca
X-Trace: newsfe08.iad 1224008842 24.79.146.116 (Tue, 14 Oct 2008 18:27:22 UTC)
NNTP-Posting-Date: Tue, 14 Oct 2008 18:27:22 UTC
Date: Tue, 14 Oct 2008 13:27:47 -0500
Xref: news.mathworks.com comp.soft-sys.matlab:495149


Eddie wrote:
> So, my understanding of the documentation of the getimage function from the Image Processing
> Toolbox is that if I say:

> xp = linspace(-10,10,350);
> fig = figure;
> plot(xp,xp.^2);
> A = getimage(fig);
 
> A should now be a matrix that contains the data relating to the pixels of the figure with
> the plotted parbola.  However, when I try this, A is empty.
> What I am doing wrong?

Look at the documentation again. getimage() returns whatever is in the first CData array
that is found under the given handle. Objects of type image have CData arrays (as well as
some other kinds of objects such as objects of type patch), but plot() creates
objects of time axes and lineseries, neither of which have CData arrays.

Perhaps what you wanted to look at was getframe().