行列のデータ点から滑らかな3D図をつくる方法

4 views (last 30 days)
rika yamada
rika yamada on 30 Oct 2019
Answered: Takumi on 30 Oct 2019
Xという31×176の行列を3Dプロットします。
mesh(X)
で添付のような形にプロットでき、概ね満足なのですが、真ん中の最大値のところで
針山のようにとがってしまうのをなんとかしたいです。(その前後での値の変化が激しすぎるからそうなっていると思います)
最大値だけをむすんだりなにか他のコマンドでもよいので、滑らかな3Dプロットの作り方があれば教えてほしいです。mesh_matlabanswers.jpg

Accepted Answer

Takumi
Takumi on 30 Oct 2019
内挿補間するのはどうでしょうか。例をあげときます。
[X,Y] = meshgrid(-1:.3:1,-2:.3:2);
V = 0.75*Y.^3 - 3*Y - 2*X.^2;
mesh(X,Y,V);
F = griddedInterpolant(X',Y',V','spline');
[Xq,Yq] = ndgrid(-1:.1:1,-2:.1:2);
Vq = F(Xq,Yq);
figure
mesh(Xq',Yq',Vq')

More Answers (0)

Categories

Find more on 行列および配列 in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!