help-octave
[Top][All Lists]
Advanced

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

Re: Splines


From: Carlo de Falco
Subject: Re: Splines
Date: Wed, 1 Oct 2008 11:18:36 +0100

I'm typing directly to email without testing,
inline documentation of the cited functions should
help in case of typo  problems ...

On 01/ott/08, at 10:26, Kearan Mc Pherson wrote:

I plot a 3D graph using two data.dat files like this :

 d1 = load graph.dat ;
d2 = load graph2.dat ;
d1 = sortrows (d1);
d2 = sortrows (d2);

x = unique ([d1(:,1); d2(:,1)]);
--------

y = interp1 (d1(:,1), d1(:,2), x, "cubic", "extrap");
z = interp1 (d2(:,1), d2(:,2), x, "cubic", "extrap");
---------

whith spline this would be:

-----------
y = spline(d1(:,1), d1(:,2), x);
z = spline(d2(:,1), d2(:,2), x);
-----------

if you have the octave-forge package "splines" installed you can also try

-----------
ycm = ppval(catmullrom(d1(:,1), d1(:,2)), x);
zcm = ppval(catmullrom(d2(:,1), d2(:,2)), x);
-----------

use
plot3 (x, y, z, x, ycm, zcm);

to compare the results

I would like to use splines, can anyone please assist me regarding this matter, as i'm new to octave and gnuplot. thanks and regards


c.


reply via email to

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