Help with Newton's Method in Matlab

Hi, I really need some help setting up a matlab program to solve this problem.

Using MATLAB, calculate and plot the real root of function : f(x) = xtanh(x) + C = 0, for C=1.5, 2.5, 3.5

I understand the basics of the Newton Method, but keep getting errors when I run this code, and don't have enough of an understanding of whats going on to correct it. This is the code I have so far:

c=1.5

n=0;

x=.1;

f=x*tanh(x)-c;

fder=tanh(x)+(x*sech(x)^2);

while n<100

newx= x - (f(x)/fder(x));

n=n+1

x=newx

end

x

If someone could give me any tips or help I would really appreciate it. Thanks in advance for your help.