Frankly speaking, I didn't understand what is the purpose of this file... & what is it supposed to do ?
Don't claim it to be 'Numerical Methods' because the above program doesn't solve / apply to any general problem.
After writing such program if you are claiming that you "have done lot of numerical methods" then please... don't share your programs here in MATLAB Central; because having done "lot of Numerical Methods" would have taught you write "general" programs.