How to perform integration over a complex path in Matlab?

Hello everyone,
I'd like to perform integration of the attached image, in order to find interal area value (white area).
Does anyone have any idea how I can do that?
Thanks in advance for your support

 Accepted Answer

Cris LaPierre
Cris LaPierre on 30 Dec 2020
Edited: Cris LaPierre on 30 Dec 2020
I would probably determine the area of the square (lxw), then figure out what percentage of the square is white (white pixels/all pixels), then multiply that by the area of the square to determine the area of the white.

2 Comments

+1. And that would be a far better solution than anything a tool like integral would do, and far simpler to compute. Remember that it would take a more effort than you would gain to define that nasty path using any curve, and to then use it to define limits for an integration. And however you tried to define that path, it would be a complicated, squirrely nest of squiggles. If instead, you tried to smooth the path using some sort of smoothing tool, then your prediction becomes no better than the approximation you used. Any lack of fit in the approximate path is now a signifcant bias in your estimate.
The virtue is that what Chris has suggested is amazingly simple. Count the white pixels in the region of interest. Multiply the number of pixels found by the effective area of one pixel.
Thanks a lot both for your support ! :)

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!