Skip to content

Commit ddb2ee7

Browse files
committed
Updated documentation, function header, and fixed typos in examples
1 parent 8f0412a commit ddb2ee7

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

EXAMPLES.mlx

-10 KB
Binary file not shown.

Fixed_Point_Iteration.pdf

1.12 KB
Binary file not shown.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# `fixed_point_iteration` [![View Fixed Point Iteration (fixed_point_iteration) on File Exchange](https://www.mathworks.com/matlabcentral/images/matlab-file-exchange.svg)](https://www.mathworks.com/matlabcentral/fileexchange/86992-fixed-point-iteration-fixed_point_iteration)
22

3-
Calculates the fixed point of a univariate function using fixed-point iteration.
3+
Calculates the fixed point of a univariate, scalar-valued function using fixed-point iteration.
44

55

66
## Syntax
@@ -13,7 +13,7 @@ Calculates the fixed point of a univariate function using fixed-point iteration.
1313

1414
`c = fixed_point_iteration(f,x0)` returns the fixed point of a function <img src="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.
1515

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 struct that has the following fields:
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:
1717
- `imax` &rightarrow; maximum number of iterations
1818
- `return_all` &rightarrow; all intermediate fixed point estimates are returned if set to `true`; otherwise, only the converged fixed point is returned
1919
- `TOL` &rightarrow; tolerance

fixed_point_iteration.m

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
%==========================================================================
22
%
3-
% fixed_point_iteration Calculates the fixed point of a univariate
4-
% function using fixed-point iteration.
3+
% fixed_point_iteration Calculates the fixed point of a univariate,
4+
% scalar-valued function using fixed-point iteration.
55
%
66
% c = fixed_point_iteration(f,x0)
77
% c = fixed_point_iteration(f,x0,opts)
88
%
9+
% See also fzero, bisection_method, newtons_method, secant_method.
10+
%
911
% Copyright © 2021 Tamas Kis
10-
% Last Update: 2021-11-22
12+
% Last Update: 2021-12-11
1113
% Website: https://tamaskis.github.io
1214
% Contact: tamas.a.kis@outlook.com
1315
%
@@ -22,16 +24,17 @@
2224
% ------
2325
% INPUT:
2426
% ------
25-
% f - (function_handle) f(x)
27+
% f - (1×1 function_handle) univariate, scalar-valued function f(x)
28+
% (f:R->R)
2629
% x0 - (1×1 double) initial guess for fixed point
27-
% opts - (OPTIONAL) (struct) solver options structure
30+
% opts - (OPTIONAL) (1×1 struct) solver options
2831
% • imax - (1×1 double) maximimum number of iterations
29-
% • return_all - (logical) all intermediate fixed point estimates
30-
% are returned if set to "true"; otherwise, a
31-
% faster algorithm is used to return only the
32-
% converged fixed point
32+
% • return_all - (1×1 logical) all intermediate fixed point
33+
% estimates are returned if set to "true";
34+
% otherwise, a faster algorithm is used to return
35+
% only the converged fixed point
3336
% • TOL - (1×1 double) tolerance
34-
% • warnings - (logical) true if any warnings should be
37+
% • warnings - (1×1 logical) true if any warnings should be
3538
% displayed, false if not
3639
%
3740
% -------

0 commit comments

Comments
 (0)