How to compute one optimized coordiante for each point groups as highlighted (blue)?

1 visualización (últimos 30 días)
Abb el 20 de Mzo. de 2023
Respondida: Pratheek el 27 de Abr. de 2023
I have red points with X Y Z coordinates as below. I want to compute one optimized X Y Z coordinates for each point groups(blue drawing)
1 comentarioMostrar -1 comentarios más antiguosOcultar -1 comentarios más antiguos
Adam Danz el 20 de Mzo. de 2023
Are you working with a grouping variable or would you also need to compute the groups?

Iniciar sesión para comentar.

Respuestas (1)

Pratheek el 27 de Abr. de 2023
Hey Abb,
If you need to compute groups from random points, you can use clustering techniques. Refer this link for more information: Cluster Analysis and Clustering Algorithms - MATLAB & Simulink (mathworks.com)
Once you have computed the groups, you can find the centroid of each group to obtain the optimized coordinate of each group.
% Set the number of points
n = 10;
% Generate random x, y, and z coordinates
x_coords = rand(n, 1);
y_coords = rand(n, 1);
z_coords = rand(n, 1);
% Create a matrix of coordinates
coords = [x_coords, y_coords, z_coords];
% Plot the points in 3D space
scatter3(coords(:,1), coords(:,2), coords(:,3), 'filled');
xlabel('X');
ylabel('Y');
zlabel('Z');
title('Random Points in 3D Space');
% Calculate the centroid of the points
centroid = mean(coords, 1);
% Plot the centroid in a different color and larger size
hold on;
scatter3(centroid(1), centroid(2), centroid(3), 100, 'r', 'filled');
hold off;
0 comentariosMostrar -2 comentarios más antiguosOcultar -2 comentarios más antiguos

Iniciar sesión para comentar.

Categorías

Más información sobre Data Analysis en Help Center y File Exchange.

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by