a = polyarea(x, y)
a = polyarea(x, y, dim)
| Parameter | Description |
|---|---|
| x, y | the vertex coordinates of the polygon, as vectors or matrices of the same size. |
| dim | a positive integer: the dimension along which the vertices run (default: the first non-singleton dimension). |
| Parameter | Description |
|---|---|
| a | the area of the polygon. |
polyarea returns the area of the polygon whose vertices are given by x and y, computed with the shoelace formula. When the inputs are matrices, the area is computed for each polygon along the chosen dimension.
a = polyarea([0 1 1 0], [0 0 1 1])
| Version | Description |
|---|---|
| 2.0.0 | Initial version. |