fixed point iteration for numerical method
This does not actually do anything useful, except clear your matlab workspace. Yes, it is a script that clears what you were just working on.
For this to be really useful, the author would need to be FAR more descriptive. In this script, the author uses iteration (as opposed to itration) to solve for a root of a nonlinear expression in x. The example posed is to solve for x such that
sin(x) - x^2 = 0
The process used is to iterate the expression
x = sqrt(sin(x));
But sadly, there is no suggestion as to why this particular form was chosen. For example, why not use the alternative
x = asin(x^2)
instead? Would this have converged more rapidly? There is no advice provided at all. What happens if you have a more complex expression? Are there any criteria one might use to know which is better?
As such, this is really completely worthless, even as a homework solution. I'd have given it no better than a C, so if you are a student who will copy this mess, you will be poorly served.
There are a few internal comments. This is good. But they are not terribly informative. For example, a tolerance is supplied, but there is no explanation at all about why the author multiples by 100 inside the computation.
Use fzero instead, a good piece of software.
Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.