|
Prev: LTR method
Next: running a Windows program from MATLAB
From: David Doria on 7 May 2008 14:05 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
From: Walter Roberson on 7 May 2008 14:13 In article <fvsr0k$n1h$1(a)fred.mathworks.com>, David Doria <daviddoria(a)gmail.com> wrote: >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." Not having the points uniformly spaced does not cause that problem. What -would- cause that problem is clicking the same location twice, such as if you were to close a curve. The message is telling you that all of the point pairs must be unique. -- "And that's the way it is." -- Walter Cronkite
From: David Doria on 7 May 2008 14:45 ah ok , great - I don't think I had clicked exactly in the same point, I think two points just had the same X coordinate - is this indeed the reason for that error?
|
Pages: 1 Prev: LTR method Next: running a Windows program from MATLAB |