Is this forum a joke for you and few your batchmates. The same to same program is already asked by someone and you are posting it again. Another program for the same problem is also asked by the different user. In the past 20 minutes, I have seen 3 people asking the problem of the same question and for the same program.
I think you are asking the same question twice on this forum. https://in.mathworks.com/matlabcentral/answers/373805-how-to-solve-the-error
Try using debugger to resolve your problem.