This script takes the input function adn solve it with the help of newton-Raphson
This implementation has several problems:
1. It is a script, which kill the current state of Matlab by a "clear all".
2. The function to be solved is defined by "d=input('Enter the Function')", but this method allows to input a numerical value only.
3. The loop "for u=0:inf" is not valid in Matlab.
4. In "x=y-[f(x)/f1(x)];" you expect f to be scalar without mentioning it. The square brackets are not useful here.
5. "if x==y" is a bad criterion due to the limited numerical precision. A test like "abs(x - y) / abs(min(x,y)) < 0.0001" would be smarter.
Therefore this code is neither useful nor usable. I cannot reconsider the reason to rate this by 5 stars.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.