MATLAB: How to input 2x*sech^2(x^2 – 9) into MATLAB

codederivavtiondfuncinputMATLABnewton raphsonsech

Hi I do not know how to put the above into MATLAB. I need it for the dfunc part of a newton-raphson method.
Thanks

Best Answer

E.g., vectorized form:
y = 2 * x .* (sech(x.^2 - 9)).^2;