MATLAB: What is the wrong in this

Error using mupadmex
Error in MuPAD command: Index exceeds matrix dimensions.
Error in sym/subsref (line 1577)
B = mupadmex('symobj::subsref',A.s,inds{:});
Error in NewtonMethod (line 13)
x(n+1)=(x(n)-(f(x))/int(f(x)));

Best Answer

We would need to see the code to be sure, but probably f(x) is a symbolic expression that involves indexing a variable at a position that does not exist.