MATLAB: How to debugg the code

image segmentation

help me how to debug my code as i am new to matlab coding.