Path: news.mathworks.com!newsfeed-00.mathworks.com!NNTP.WPI.EDU!elk.ncren.net!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: how to draw an irregular shape on GUI axes?
Date: Thu, 2 Aug 2007 22:21:11 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 26
Message-ID: <f8tlcn$q9b$1@canopus.cc.umanitoba.ca>
References: <f8td95$i7t$1@fred.mathworks.com> <f8tenc$hke$1@canopus.cc.umanitoba.ca> <f8tg0t$46b$1@fred.mathworks.com>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1186093271 26923 192.70.172.160 (2 Aug 2007 22:21:11 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Thu, 2 Aug 2007 22:21:11 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:422263


In article <f8tg0t$46b$1@fred.mathworks.com>,
Kathleen  <quisquiliae2@hotmail.com> wrote:

>I have tried the following code:

>    X = {-0.5, -0.2,-0.1,-0.4, -0.6, -0.5};
>    Y = {-0.15, 0.1, 0.4, 0.5, 0.2, -0.15};
>    patch(X, Y, 'c');

>within my draw_plot() function and tried fill() as well. 
>However, for both patch() and fill() function calls, I get 
>the error:

>??? Error using ==> patch [or fill]
>Conversion to double from cell is not possible.

>As far as I can tell, my code above should work. Any 
>suggestions about what I might be doing wrong?

Use arrays instead of cells.
X = [-0.5, -0.2,-0.1,-0.4, -0.6, -0.5];
Y = [-0.15, 0.1, 0.4, 0.5, 0.2, -0.1];

patch() and fill() are defined over matrices, not over cell arrays.
-- 
Programming is what happens while you're busy making other plans.