不規則な位置座標に値を格納,プロット

MATLAB初心者になります.
下記のようなデータをプロットするにはどのようにすればよろしいでしょうか.
イメージ的には不規則なx,y,zの座標にnの値に応じたカラースケールで表示したいです.
ご教授お願いいたします.
x y z n
-0.0993 0.1685 0.0972 2.7584
-0.0995 0.1687 0.0972 2.6406
-0.0998 0.1688 0.0972 2.8534
-0.1001 0.1689 0.0972 3.3319
-0.1004 0.1691 0.0972 4.5871

Answers (1)

Akira Agata
Akira Agata on 25 Jan 2020

0 votes

単純に、それぞれのデータ点をnの値に応じた色で表示するには、以下のようにすれば可能です。データ点が十分にあるようであれば、scatteredInterpolant関数で内挿して、等値面などの形で表示するという方法もあります。
figure
scatter3(x,y,z,[],n,'filled')
xlabel('X','FontSize',12)
ylabel('Y','FontSize',12)
zlabel('Z','FontSize',12)
colorbar
scatter3.png

1 Comment

Ryota Kobayashi
Ryota Kobayashi on 27 Jan 2020
ありがとうございます。 解決いたしました!
加えて質問なのですが、 流線を書くことは可能でしょうか?
データとしては位置(x,y,z)とベクトル成分(u,v,w)を持っている状態です。 例によって位置は不規則です

Sign in to comment.

Products

Asked:

on 24 Jan 2020

Commented:

on 27 Jan 2020

Community Treasure Hunt

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

Start Hunting!