Need to draw a polygon on the figure from scatter3d function.

3 views (last 30 days)
%I have several points with theirs 3D coordinates (attached xlsx file). I read these values from xls file with uigetfile. Then I create coordinate system to view these coordinates in figure.
% I need to draw a polygon with these points for calculating area and volume associated with these coordinates. For doing this, I need to get these points coordinates when I click on them and draw polygon with these points which clicked on.
here the example,
[FileName1,PathName] = uigetfile('*.xlsx','Select the excel file')
[num,txt1,raw] = xlsread(FileName1)
points_id=raw(:,1)
x_cell=raw(:,2)
x=cell2mat(x_cell)
y_cell=raw(:,3)
y=cell2mat(y_cell)
z_cell=raw(:,4)
z=cell2mat(z_cell)
figure(1),scatter3(y, x, z, 'b*');grid on;
text(y, x, z, points_id); %do this after the plotting or labels will not show up
title('COORDINATE AXES')
xlabel('Y')
ylabel('X')
zlabel('H')

Answers (0)

Categories

Find more on Triangulation Representation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!