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.