How to get area of a polygon in matlab

2 Ansichten (letzte 30 Tage)
SUSHMA MB
SUSHMA MB am 10 Apr. 2015
Beantwortet: Stalin Samuel am 10 Apr. 2015
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?

Akzeptierte Antwort

Stalin Samuel
Stalin Samuel am 10 Apr. 2015
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)

Weitere Antworten (1)

Thomas Koelen
Thomas Koelen am 10 Apr. 2015

Kategorien

Mehr zu Elementary Polygons finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by