필터 지우기
필터 지우기

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 CenterFile Exchange에서 Surface 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