How to measure surface area layer by layer using Matlab
古いコメントを表示
i am using following code to find area of layers. I am trying but masking somewhere some mistake. Any help from community will be highly appreciated.
Attached file are the xyz-coordinates. I measure the surface area of one layer using bellow code. This coding is combining all layers. I want to find area of each layer individually. Regards to all for their cooperation and guidance.
vertices = load(' attached file ')
vertices = round(sortrows(vertices,2));
Vx = round(vertices(:,1));
Vy = round(vertices(:,2));
Vz = round(vertices(:,3));
G_surface_area =0
layer = []
surface_area = 0
for i = min(Vy):10:max(Vy) % This for loop, i am using to measure by 10 spacing.
minVy = i
for j = i:i + 9 % This measure is for layer to find its area.
layer_new = vertices(any(Vy== j,2),:);
layer = [layer; {layer_new}];
end
layer = cell2mat(layer)
Lx = layer(:,1);
Ly = layer(:,2);
Lz = layer(:,3);
surface_area = polyarea(Lx,Lz)
G_surface_area = G_surface_area + surface_area
end
採用された回答
その他の回答 (1 件)
M.S. Khan
2020 年 8 月 24 日
4 件のコメント
KSSV
2020 年 8 月 24 日
Yes this should work...This will give you the surface area.
trimesh(TO)
The above mesh was all cone? Actually I don't have access to MATLAB. I work on Octave and many functions are missing in it. Else I would have tried for complete working code.
M.S. Khan
2020 年 8 月 24 日
KSSV
2020 年 8 月 24 日
That's good... hope the present answer and your formula obtained value are close. You can mail me through my author page or send me linkedin request, we can keep in touch.
M.S. Khan
2020 年 8 月 24 日
カテゴリ
ヘルプ センター および File Exchange で Modulation についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!