Finding the area of a non-uniform shape

662 views Asked by At

I was wondering if anyone here has experience with finding the area of a non-uniform shape in MATLAB. I would like to know which method will give me the best approximation.

1

There are 1 answers

0
Fuzz On

The built-in method polyarea is reasonably popular. It takes a list of X and Y points for a polygon and calculates the area.

e.g.

points = [ 0 0; 0 10; 10 10; 0 10; 0 0 ];
area = polyarea(points(:,1), points(:,2))

Note that I've close the polygon before passing it to polyarea