help-octave
[Top][All Lists]
Advanced

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

Re: Interpolation in N dimension


From: Michele
Subject: Re: Interpolation in N dimension
Date: Tue, 1 Oct 2019 15:47:36 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0

On 10/1/19 11:51 AM, Damir wrote:
Hello,
I'm trying to use "interpn function" and probing even a simple 2D example in
the att.  I cannot reproduce the interpolation value FUN(xi,yi)  compared to
the matrix grid value i.e. FUN(1,11) != 4. Would appreciate advice on this,
cheers, Damir


Code

--------------------

A = [13,-1,12;5,4,3;1,6,2];

x = [0,1,2];
y = [10,11,12];

xi = linspace (min (x), max (x), 30);
yi = linspace (min (y), max (y), 60);
FUN = interpn (x, y, A, xi, yi, "spline");


disp("value(1,11) = "), FUN(1, 11)

Hi,

that's because FUN is a matrix (you already evaluated the interpolator in (xi,yi)). When you call FUN(1,11) you are showing the function interpolated at (xi(1), yi(11)) = (0, 10.339), not at (xi,yi)=(1,11).

Michele



--
Sent from: https://octave.1599824.n4.nabble.com/Octave-General-f1599825.html





reply via email to

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