Programmer Guide/Command Reference/EVAL/ydiff: Difference between revisions
From STX Wiki
< Programmer Guide | Command Reference | EVAL
Jump to navigationJump to search
m (1 revision: Initial import) |
No edit summary |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:{{SUBPAGENAME}}}} | {{DISPLAYTITLE:{{SUBPAGENAME}}}} | ||
==== | Calculates the differentiation (differnce quotients) of the vector ''y'' = f(''x''). | ||
---- | |||
;Usage 1: <code>ydiff(<var>y<sub>vector</sub></var> {, <var>dx<sub>scalar</sub></var>=1})</code> | |||
;Result 1: The result is the vector ''r'' with <code>nrow(''y'')-1</code>elements. | |||
::<code>''r''[i]=(''y''[i+1]-''y''[i])/dx; with: i=0..nrow(''y'')-2</code> | |||
---- | |||
;Usage 2: <code>ydiff(<var>y<sub>vector</sub></var>, <var>x<sub>vector</sub></var>)</code> | |||
;Result 2: The result is the vector ''r'' with <code>nrow(''y'')-1</code>elements. | |||
::<code>''r''[i]=(''y''[i+1]-''y''[i])/(''x''[i+1]-''x''[i]); with: i=0..nrow(''y'')-2</code> | |||
---- | |||
;Usage 3: <code>ydiff(<var>k<sub>number</sub></var>, <var>x<sub>vector</sub></var>)</code> | |||
;Result 3: The result is the vector ''r'' with <code>nrow(''y'')-1</code>elements. This version is normally used for signal differentiation (with: 0 ≤ <var>k<sub>number</sub></var> ≤ 1). | |||
::<code>''r''[i]=''x''[i+1]-''k''.''x''[i]; with: i=0..nrow(''y'')-2</code> | |||
;See also: [[../yint|yint]] | |||
[[../#Functions|<function list>]] | |||
Latest revision as of 09:09, 9 March 2018
Calculates the differentiation (differnce quotients) of the vector y = f(x).
- Usage 1
ydiff(yvector {, dxscalar=1})
- Result 1
- The result is the vector r with
nrow(y)-1
elements.r[i]=(y[i+1]-y[i])/dx; with: i=0..nrow(y)-2
- Usage 2
ydiff(yvector, xvector)
- Result 2
- The result is the vector r with
nrow(y)-1
elements.r[i]=(y[i+1]-y[i])/(x[i+1]-x[i]); with: i=0..nrow(y)-2
- Usage 3
ydiff(knumber, xvector)
- Result 3
- The result is the vector r with
nrow(y)-1
elements. This version is normally used for signal differentiation (with: 0 ≤ knumber ≤ 1).r[i]=x[i+1]-k.x[i]; with: i=0..nrow(y)-2
- See also
- yint