Effacer les filtres
Effacer les filtres

How to create a 3D surface plot from scatter3?

15 vues (au cours des 30 derniers jours)
SAHOO Sudeep Kumar
SAHOO Sudeep Kumar le 22 Juin 2022
Modifié(e) : Chunru le 24 Juin 2022
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);

Réponses (1)

Chunru
Chunru le 24 Juin 2022
Modifié(e) : Chunru le 24 Juin 2022
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')

Produits


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by