メインコンテンツ

テンソル積スプラインによる N 次元グリッドでの値の近似

ベクトル値スプラインは、"テンソル積" スプラインを使用した、任意の数の変数における "グリッド データ" への近似でも使用されます。同じスプライン作成コマンドが使用されますが、入力形式のみが異なります。たとえば、xm ベクトル、yn ベクトル、z がサイズ [m,n] の配列の場合、cs = csapi({x,y},z); は、i=1:m,j=1:n の場合に、f(x(i),y(j))=z(i,j) を満たす双三次スプライン f を示しています。このような多変量スプラインは、ベクトル値となることがあります。たとえば、次は、完全に許容可能な球体を提供します。

x = 0:4;
y = -2:2;
s2 = 1/sqrt(2);
z(3,:,:) = [0 1 s2 0 -s2 -1 0].'*[1 1 1 1 1];
z(2,:,:) = [1 0 s2 1 s2 0 -1].'*[0 1 0 -1 0];
z(1,:,:) = [1 0 s2 1 s2 0 -1].'*[1 0 -1 0 1];
sph = csape({x,y},z,["clamped","periodic"]);
fnplt(sph)
axis equal
axis off
title("Sphere Made by 3-D-Valued " + ...
    "Bivariate Tensor Product Spline")

Figure contains an axes object. The hidden axes object with title Sphere Made by 3-D-Valued Bivariate Tensor Product Spline contains an object of type surface.

この球体の (x,z) 面への投影は、次によってプロットされます。

fnplt(fncmb(sph,[1 0 0; 0 0 1]))
axis equal
axis off
title("Planar Projection of Spline Sphere")

Figure contains an axes object. The hidden axes object with title Planar Projection of Spline Sphere contains an object of type line.