フィルターのクリア

How to create a 3D surface plot from scatter3?

16 ビュー (過去 30 日間)
SAHOO Sudeep Kumar
SAHOO Sudeep Kumar 2022 年 6 月 22 日
編集済み: Chunru 2022 年 6 月 24 日
Hello All,
I would like to create a 3D surface plot from the 625 data points which are taken at certain intervals. Each data points in a row represents a vector with its X,Y and Z values represented in the first, second and third column, respectively. Using scatter3 function I can visualize the results. Below is the code. But I need to represent it in the form of a continuous 3Dsurface for better visualization.
Could anyone suggest me how can I proceed?
For creating the 3D surface the colour code should follow: sqrt(x^2+y^2+z^2)
The test.txt file is also included in order to have a look.
Thanking you in advance.
test=load('test.txt');
x = test(:,1);
y = test(:,2);
z = test(:,3);
s=scatter3(x,y,z);
view(3);

回答 (1 件)

Chunru
Chunru 2022 年 6 月 24 日
編集済み: Chunru 2022 年 6 月 24 日
test=load('test.txt');
x = test(:,1);
y = test(:,2);
z = test(:,3);
s=scatter3(x,y,z);
view(3);
figure
dt = delaunayTriangulation(x, y, z);
Warning: Duplicate data points have been detected and removed.
The Triangulation indices are defined with respect to the unique set of points in delaunayTriangulation.
figure
tetramesh(dt, 'EdgeColor', 'none')

カテゴリ

Help Center および File ExchangeSurface and Mesh Plots についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by