How to get area of a polygon in matlab
2 ビュー (過去 30 日間)
古いコメントを表示
I have coordinates of a polygon saved in excel sheet, now i want to get the area of the polygon in matlab. First i will make the excel sheet read in matlab, then after that how to get the area?
0 件のコメント
採用された回答
Stalin Samuel
2015 年 4 月 10 日
for example
data =[4,10;9,7;11,2;2,2;4,10]%from excel file
data(5,:) =data(1,:)
for i=1:max(size(data))-1
s(i)=data(i,1) *data(i+1,2)-data(i,2)*data(i+1,1)
end
area = abs(sum(s)/2)
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
Help Center および File Exchange で Elementary Polygons についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!