Please in future give a description of the kind of error you are getting, and any error messages.
Originally Posted by ajmilano
f and fder are not functions the way you have written this.
To make them anonymous functions try:
Also the loop structure you are using is not ideal, as this should only need ~5 itterations to converge, you need to compare itterates and when the change is less than some threshold exit the loop.
newx= x - (f(x)/fder(x));
I would also suggest you start further from 0 than 0.1, 1 should be better.