A = area( returns the total area
polyshape object, which is the sum of the areas of the solid
regions that make up the
Area of Polygon
Create a polygon containing multiple solid regions and one hole, and compute its area.
P = [0 0; 0 2; 2 2; 2 0; NaN NaN; 0.5 0.5; 0.5 1.5; 1.5 1.5; 1.5 0.5; NaN NaN; 3 0.5; 3.5 1.5; 4 0.5]; polyin = polyshape(P); plot(polyin) axis equal
A = area(polyin)
A = 3.5000
polyin — Input
scalar | vector | matrix | multidimensional array
polyshape, specified as a scalar, vector, matrix,
or multidimensional array.
I — Boundary index
scalar integer | vector of integers
Boundary index, specified as a scalar integer or vector of integers. Each
I corresponds to a single boundary of the