Hello Mr. Hamza, one thing, In your corrected code if in line 98 instead of "interploation_points' if I decide to use m1 values of line 92, then it gives me unequal row length among 20 interpolation X Y pairs after interpolation has been done. the problem is then matlab can not take average of columns with unequal row length.
Is there any how it can be done in matlab with unequal matrix dimension? If not then by putting zeros on that rows which comes shorter_length than others. So basically then making the matrix of dimension of the max length row with a code and filled other shorter row length with zeros.