help-octave
[Top][All Lists]
Advanced

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

Re: Splines


From: Jaroslav Hajek
Subject: Re: Splines
Date: Wed, 1 Oct 2008 11:56:11 +0200

On Wed, Oct 1, 2008 at 11:26 AM, Kearan Mc Pherson
<address@hidden> wrote:
> Hi
>
> 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");
>
>  plot3 (x, y, z);
>

The interp1 functions *are* using splines when you specify "cubic"
interpolation.
To get a denser sample, you can add
x = linspace (min(x), max(x), 1000).';
or something similar after the `x = unique' line.



> 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
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>
>



-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

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