help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: plotting a spline


From: Kai Habel
Subject: Re: plotting a spline
Date: Thu, 27 Apr 2000 19:39:50 +0200

David DS Barnes wrote:
> 
> Hi All,
> 
> sorry to ask a lowbrow question like this,
> 
> but can anyone tell me how to plot a set of points with a spline or
> curve,
> rather than as a line?
>
Hello David,

take a look at Paul Kienzle's signalPAK Toolbox[1], there you can find
the
functions spline.m and interp1.m.

If you want to interpolate your data points using a cubic spline you
can do.

#create example data
x=rand(1,11);
y=0:0.1:1.0;

#100 new points
xi=linspace(0,1,100);
yi=interp1(x,y,xi,'spline');
#plotting
plot(x,y,'bo');
hold on
plot(xi,yi);
hold off

HTH, Kai

[1] http://users.powernet.co.uk/kienzle/signalPAK/index.html

-- 
Kai Habel
mailto:address@hidden



-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.che.wisc.edu/octave/octave.html
How to fund new projects:  http://www.che.wisc.edu/octave/funding.html
Subscription information:  http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------



reply via email to

[Prev in Thread] Current Thread [Next in Thread]