sfit型からの3次元等高線の作成

まず、測定点間を補間する曲面を"fit"関数を使って近似し、この操作によりsfitの型に近似曲面が作られました。 そのあと"plot"関数を用いて図の通り3次元の曲面と2次元の等高線をつくる所までできました。 しかし、3次元の等高線が作れず困っています。解決方法があれば教えていただけないでしょうか? (Web上で色々調べたのですが、plot関数でsfit型からの3次元等高線の命令が見つかりませんでした。)
x=[1;1;2;2;2;2;3;3;3;3;4;4];
y=[2;3;1;2;3;4;1;2;3;4;2;3];
Z=[89;90.7;87.5;90.9;91.8;90.4;90.5;90.1;86.1;91.8;91;92.3];
sf = fit([x, y],Z,'cubicinterp');
%3次元プロット
figure;
plot(sf,[x,y],Z);
%等高線プロット
figure;
plot(sf, [x,y],Z,'Style', 'Contour');

2 comentarios

michio
michio el 16 de Nov. de 2017
3次元等高線とはどういうイメージでしょうか?何か参考になる画像があれば教えてください。
iga50storm
iga50storm el 16 de Nov. de 2017
コメントありがとうございます。 contour3で描かれる等高線をイメージしています。

Iniciar sesión para comentar.

 Respuesta aceptada

Jiro Doke
Jiro Doke el 16 de Nov. de 2017
Editada: Jiro Doke el 17 de Nov. de 2017

2 votos

sfit オブジェクトを使って X Y のグリッドに対して再評価し、 contour3 を呼べば良いと思います。
xx = linspace(min(x),max(x));
yy = linspace(min(y),max(y));
[XX,YY] = meshgrid(xx,yy);
ZZ = sf(XX,YY);
figure
contour3(XX,YY,ZZ,30)

1 comentario

iga50storm
iga50storm el 16 de Nov. de 2017
解決致しました。 ご丁寧にソースコードまでありがとうございました。

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Preguntada:

el 16 de Nov. de 2017

Editada:

el 17 de Nov. de 2017

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!