Path: news.mathworks.com!not-for-mail
From: "David Doria" <daviddoria@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Spline through non uniformly spaced points
Date: Wed, 7 May 2008 18:05:09 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 27
Message-ID: <fvsr0k$n1h$1@fred.mathworks.com>
Reply-To: "David Doria" <daviddoria@gmail.com>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210183509 23601 172.30.248.35 (7 May 2008 18:05:09 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 May 2008 18:05:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1105197
Xref: news.mathworks.com comp.soft-sys.matlab:467217



I want to do something like this:

a=axes;
set(a,'xlim',[-2 2]);
set(a,'ylim',[-2 2]);
[x y] = ginput;

%click a bunch of points

%draw a spline through the points
xx=-2:.01:2;
yy=spline(x, y, xx);

the problem seems to be that the points I have clicked are
not uniformly spaced (clearly) so i get the following:
"The data sites should be distinct."

I've used meshgrid before, but it seems to be more for
plotting 3d functions.. i'm not sure how to "snap" these
coordinates to a grid without giving them some kind of "z"
value.

Any suggestions?

Thanks,

Dave