MATLAB: Can matlab calculate the area of irregular shape base on 2D-grid
irregular shape
if has, please help me to find the proper solution
Best Answer
No, in the general case the area of irregular shaped objects is not defined. See https://en.m.wikipedia.org/wiki/Koch_snowflake as an example: it encloses finite area but has infinite perimeter.
It is possible that the shapes of interest to you are one of the special cases that can be resolved, but you asked the general question, not the specific one.
Not sure I see the problem. You apparently have cross sections in say x and y, presumably, at various values for z. That means you know the boundary of that cross sectional shape in the form of a piecewise linear polygonal shape. So use a tool like polyarea, to compute the area of each cross section in the (x,y) plane. Now, apply rectangle rule, or better yet, perhaps trapx, to integrate in the z dimension.
Best Answer