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

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ヘルプ >> Interpolation > interp

interp

3次スプライン評価関数

呼び出し手順

[yp [,yp1 [,yp2 [,yp3]]]]=interp(xp, x, y, d [, out_mode])

引数

x,y

同じ大きさ n の実数ベクトル: 補間および関連する3次スプライン (以下,s(X)と呼びます)または サブスプライン関数を定義します.

d

size(x)の実数ベクトル: 微分 s'(x). 多くの場合, s'(x) は関数splin(x, y,..)により 適当に推定されます.

out_mode

(オプション)の外側で. X に対するs(X)を定義します. 利用可能な値: "by_zero" | "by_nan" | "C0" | "natural" | "linear" | "periodic"

xp

実数ベクトルまたは行列: Y が未知の座標で, s(xp)で推定されます

yp

size(xp)のベクトルまたは行列: yp(i) = s(xp(i)) または yp(i,j) = s(xp(i,j))

yp1, yp2, yp3

size(x) のベクトル(または行列): 微分s'(xp), s''(xp) および s'''(xp)の要素毎の評価.

説明

指定した点の(x,y) 集合を補間する3次スプライン関数 s(X) は,の範囲で定義された,連続で微分可能な関数です. これは,3次元多項式の集合からなり,その各々はで定義され, 隣接する多項式と値と傾きで接続されています. つまり, の各々について, を記述できます.

out_modeパラメータは 補外,すなわち,xp(i) の範囲にない場合 の評価規則を設定します :

"by_zero"

0による補外が行われます

"by_nan"

Nan (%nan)による補外

"C0"

以下のように定義される補外 :

"natural"

以下のように定義される補外 ( は, においてs(X)を定義する多項式です)

"linear"

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

"periodic"

s は周期性により拡張されます.

// splin および lsq_splinの例を参照
// スプラインおよびサブスプラインの C2およびC1連続性を示す例
a = -8; b = 8;
x = linspace(a,b,20)';
y = sinc(x);
dk = splin(x,y);  // not_a_knot
df = splin(x,y, "fast");
xx = linspace(a,b,800)';
[yyk, yy1k, yy2k] = interp(xx, x, y, dk); 
[yyf, yy1f, yy2f] = interp(xx, x, y, df); 
clf()
subplot(3,1,1)
plot2d(xx, [yyk yyf])
plot2d(x, y, style=-9)
legends(["not_a_knot spline","fast sub-spline","interpolation points"],...
        [1 2 -9], "ur",%f)
xtitle("spline interpolation")
subplot(3,1,2)
plot2d(xx, [yy1k yy1f])
legends(["not_a_knot spline","fast sub-spline"], [1 2], "ur",%f)
xtitle("spline interpolation (derivatives)")
subplot(3,1,3)
plot2d(xx, [yy2k yy2f])
legends(["not_a_knot spline","fast sub-spline"], [1 2], "lr",%f)
xtitle("spline interpolation (second derivatives)")
// 異なる補外の方法を示す例
x = linspace(0,1,11)';
y = cosh(x-0.5);
d = splin(x,y);
xx = linspace(-0.5,1.5,401)';
yy0 = interp(xx,x,y,d,"C0");
yy1 = interp(xx,x,y,d,"linear");
yy2 = interp(xx,x,y,d,"natural");
yy3 = interp(xx,x,y,d,"periodic");  
clf()
plot2d(xx,[yy0 yy1 yy2 yy3],style=2:5,frameflag=2,leg="C0@linear@natural@periodic")
xtitle(" different way to evaluate a spline outside its domain")

参照

  • splin — 3次スプライン補間
  • lsq_splin — 重み付き最小二乗三次スプラインフィッティング

履歴

バージョン記述
5.4.0 以前では, 入力引数の虚部は暗黙のうちに無視されていました.
Report an issue
<< eval_cshep2d Interpolation interp1 >>

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:
Wed Apr 01 10:25:00 CEST 2015