Programmer Guide/Command Reference/EVAL/rpoly: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
No edit summary |
No edit summary |
||
(3 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
Evaluate polynom with real coefficients. | Evaluate polynom with real coefficients. | ||
;Usage: <code> | ;Usage: <code>rpoly(<var>a</var>, <var>x</var>)</code>: | ||
:;<var>a</var>: a vector containing the polynom coefficients | :;<var>a</var>: a vector containing the polynom coefficients | ||
:;<var>x</var>: a scalar, vector or | :;<var>x</var>: a scalar, vector or matrix | ||
;Result: The result ''y'' has the same type as ''x''. | ;Result: The result ''y'' has the same type as ''x''. | ||
::<code>''y''[i,j] = ''a''[0] + ''a''[1]*''x''[i,j] + ''a''[2]*''x''[i,j]^2 + ... + ''a''[m]*''x''[i,j]^m</code> | ::<code>''y''[i,j] = ''a''[0] + ''a''[1]*''x''[i,j] + ''a''[2]*''x''[i,j]^2 + ... + ''a''[m]*''x''[i,j]^m</code> | ||
::<code>with: m = polynom order = ncol(''a'')-1</code> | ::<code>with: m = polynom order = ncol(''a'')-1</code> | ||
;See also: [[ | ;See also: [[../rpolyreg|rpolyreg]], [[../interp|interp]] | ||
[[ | [[../#Functions|<function list>]] |
Latest revision as of 09:41, 15 May 2023
Evaluate polynom with real coefficients.
- Usage
rpoly(a, x)
:- a
- a vector containing the polynom coefficients
- x
- a scalar, vector or matrix
- Result
- The result y has the same type as x.
y[i,j] = a[0] + a[1]*x[i,j] + a[2]*x[i,j]^2 + ... + a[m]*x[i,j]^m
with: m = polynom order = ncol(a)-1