MATLAB: How to fill everything below the white thing line in this image

digital image processingimageimage analysisimage processinginterpolationMATLAB

In the image I have attached, how can I fill the entire area below the thin white line plotted? Thank you!

Best Answer

By adapting the following smaller example,
A =
1 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0
0 0 1 0 0 0 0 0
0 0 0 1 0 0 0 0
0 0 0 0 1 0 0 0
0 0 0 0 0 1 1 1
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
>> B=cummax(A,1)
B =
1 0 0 0 0 0 0 0
1 1 0 0 0 0 0 0
1 1 1 0 0 0 0 0
1 1 1 1 0 0 0 0
1 1 1 1 1 0 0 0
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1