How to get area of a polygon in matlab

조회 수: 2 (최근 30일)
SUSHMA MB
SUSHMA MB 2015년 4월 10일
답변: Stalin Samuel 2015년 4월 10일
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?

채택된 답변

Stalin Samuel
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)

추가 답변 (1개)

Thomas Koelen
Thomas Koelen 2015년 4월 10일

카테고리

Help CenterFile Exchange에서 Elementary Polygons에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by