Need to draw a polygon on the figure from scatter3d function.
1 次查看(过去 30 天)
显示 更早的评论
%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')
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Exploration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!