Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.1 - 日本語

Change language to:
English - Français - Português

Please note that the recommended version of Scilab is 2024.0.0. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Interpolation > interp2d

interp2d

双3次スプライン (2d) 評価関数

呼び出し手順

[zp[,dzpdx,dzpdy[,d2zpdxx,d2zpdxy,d2zpdyy]]]=interp2d(xp,yp,x,y,C [,out_mode])

パラメータ

xp, yp

同じ大きさの実数行列または行列

x,y,C

双3次スプラインまたはサブスプライン関数を定義する実数ベクトル (以下sと呼びます)

out_mode

[x(1),x(nx)]x[y(1),y(ny)]の外にある値の評価方法を定義する(オプションの)文字列

zp

xp および ypと同じ形式のベクトルまたは行列 , これらの点におけるsの要素毎の評価.

dzpdx, dzpdy

xp および ypと同じ形式のベクトル (または行列) これらの点におけるsの要素毎の1次微分.

d2zpdxx, d2zpdxy, d2zpdyy

xp および ypと同じ形式の ベクトル (または行列), これらの点におけるsの要素毎の2次微分.

説明

双3次スプラインまたはサブスプライン関数を定義する 3つのベクトル (x,y,C) (splin2d参照)を指定すると, この関数は, 次のように(xp(i),yp(i))における s (要すれば ds/dx, ds/dy, d2s/dxx, d2s/dxy, d2s/dyyも)を評価します:

out_mode パラメータは, 捕外,すなわち(xp(i),yp(i))が [x(1),x(nx)]x[y(1),y(ny)]にない場合, の計算手法を定義します:

"by_zero"

ゼロによる捕外が行われます

"by_nan"

Nanによる捕外

"C0"

捕外は以下のように定義されます :

s(x,y) = s(proj(x,y)) where proj(x,y) is nearest point 
                      of [x(1),x(nx)]x[y(1),y(ny)] from (x,y)
"natural"

捕外は(x,y)から最も近い双三次パッチにより行われます.

"periodic"

s は周期的に拡張されます.

// see the examples of splin2d

// this example shows some different extrapolation features
// interpolation of cos(x)cos(y)
n = 7;  // a n x n interpolation grid
x = linspace(0,2*%pi,n); y = x;
z = cos(x')*cos(y);
C = splin2d(x, y, z, "periodic");

// now evaluate on a bigger domain than [0,2pi]x [0,2pi]
m = 80; // discretisation parameter of the evaluation grid
xx = linspace(-0.5*%pi,2.5*%pi,m); yy = xx;
[XX,YY] = ndgrid(xx,yy);
zz1 = interp2d(XX,YY, x, y, C, "C0");
zz2 = interp2d(XX,YY, x, y, C, "by_zero");
zz3 = interp2d(XX,YY, x, y, C, "periodic");
zz4 = interp2d(XX,YY, x, y, C, "natural");
clf()
subplot(2,2,1)
plot3d(xx, yy, zz1, flag=[2 6 4])
xtitle("extrapolation with the C0 outmode")
subplot(2,2,2)
plot3d(xx, yy, zz2, flag=[2 6 4])
xtitle("extrapolation with the by_zero outmode")
subplot(2,2,3)
plot3d(xx, yy, zz3, flag=[2 6 4])
xtitle("extrapolation with the periodic outmode")
subplot(2,2,4)
plot3d(xx, yy, zz4, flag=[2 6 4])
xtitle("extrapolation with the natural outmode")
xselect()

参照

  • splin2d — 双3次スプラインのグリッド2次元補間

作者

B. Pincon

<< interp1 Interpolation interp3d >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu Mar 03 11:00:52 CET 2011