You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# `fixed_point_iteration`[](https://www.mathworks.com/matlabcentral/fileexchange/86992-fixed-point-iteration-fixed_point_iteration)
2
2
3
-
Calculates the fixed point of a univariate, scalar-valued function using fixed-point iteration.
3
+
Fixed-point iteration for finding the fixed point of a univariate, scalar-valued function.
4
4
5
5
6
6
## Syntax
7
7
8
8
`c = fixed_point_iteration(f,x0)`\
9
-
`c = fixed_point_iteration(f,x0,opts)`
9
+
`c = fixed_point_iteration(f,x0,opts)`\
10
+
`[c,k] = fixed_point_iteration(__)`\
11
+
`[c,k,c_all] = fixed_point_iteration(__)`
10
12
11
13
12
14
## Description
13
15
14
-
`c = fixed_point_iteration(f,x0)` returns the fixed point of a function <imgsrc="https://latex.codecogs.com/svg.latex?\inline&space;f(x)"title="f(x)" /> specified by the function handle `f`, where `x0` is an initial guess of the fixed point. The default tolerance and maximum number of iterations are `TOL = 1e-12` and `imax = 1e6`, respectively.
16
+
`c = fixed_point_iteration(f,x0)` returns the fixed point of a function <imgsrc="https://latex.codecogs.com/svg.latex?\inline&space;f(x)"title="f(x)" /> specified by the function handle `f`, where `x0` is an initial guess of the fixed point.
15
17
16
-
`c = fixed_point_iteration(f,x0,opts)` does the same as the syntax above, but allows for the specification of optional solver parameters. `opts` is a structure that has the following fields:
17
-
-`imax`→ maximum number of iterations (defaults to <imgsrc="https://latex.codecogs.com/svg.latex?\inline&space;10^{6}"title="" />)
18
-
-`return_all`→ all intermediate fixed point estimates are returned if set to `true`; otherwise, only the converged fixed point is returned (defaults to `false`)
19
-
-`TOL`→ tolerance (defaults to <imgsrc="https://latex.codecogs.com/svg.latex?\inline&space;10^{-12}"title="" />)
20
-
-`warnings`→`true` if any warnings should be displayed, `false` if not (defaults to `true`)
18
+
`c = fixed_point_iteration(f,x0,opts)` does the same as the syntax above, but allows for the specification of optional solver parameters. `opts` is a structure with the following fields:
19
+
-`k_max`→ maximum number of iterations (defaults to 200)
20
+
-`return_all`→ returns estimates at all iteration if set to `true` (defaults to `false`)
21
+
-`TOL`→ tolerance (defaults to <imgsrc="https://latex.codecogs.com/svg.latex?\inline&space;10^{-10}"title="" />)
21
22
23
+
`[c,k] = fixed_point_iteration(__)` also returns the number of iterations (`k`) performed of fixed-point iteration.
24
+
25
+
`[c,k,c_all] = fixed_point_iteration(__)` does the same as the previous syntaxes, but also returns an array (`c_all`) storing the fixed point estimates at each iteration. This syntax requires that `opts.return_all` be set to true.
22
26
23
27
## Examples and Additional Documentation
24
28
25
29
- See "EXAMPLES.mlx" or the "Examples" tab on the File Exchange page for examples.
26
-
- See ["Fixed_Point_Iteration.pdf"](https://tamaskis.github.io/documentation/Fixed_Point_Iteration.pdf) (also included with download) for the technical documentation.
30
+
- See ["Root_Finding_Methods.pdf"](https://tamaskis.github.io/documentation/Root_Finding_Methods.pdf) (also included with download) for the technical documentation.
0 commit comments