Mercurial > hg > octave-lyh
comparison scripts/general/diff.m @ 3369:f37ca3017116
[project @ 1999-11-21 16:26:02 by jwe]
author | jwe |
---|---|
date | Sun, 21 Nov 1999 16:26:08 +0000 |
parents | 1dca28c213f0 |
children | f8dde1807dee |
comparison
equal
deleted
inserted
replaced
3368:a4cd1e9d9962 | 3369:f37ca3017116 |
---|---|
12 ## | 12 ## |
13 ## You should have received a copy of the GNU General Public License | 13 ## You should have received a copy of the GNU General Public License |
14 ## along with this file. If not, write to the Free Software Foundation, | 14 ## along with this file. If not, write to the Free Software Foundation, |
15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | 15 ## 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
16 | 16 |
17 ## usage: diff (x [, k]) | 17 ## -*- texinfo -*- |
18 ## | 18 ## @deftypefn {Function File} {} diff (@var{x}, @var{k}) |
19 ## If x is a vector of length n, diff (x) is the vector of first | 19 ## If @var{x} is a vector of length @var{n}, @code{diff (@var{x})} is the |
20 ## differences x(2) - x(1), ..., x(n) - x(n-1). | 20 ## vector of first differences |
21 ## | 21 ## @iftex |
22 ## If x is a matrix, diff (x) is the matrix of column differences. | 22 ## @tex |
23 ## diff (x, k), where k is a nonnegative integer, returns the k-th | 23 ## $x_2 - x_1, \ldots{}, x_n - x_{n-1}$. |
24 ## @end tex | |
25 ## @end iftex | |
26 ## @ifinfo | |
27 ## @var{x}(2) - @var{x}(1), @dots{}, @var{x}(n) - @var{x}(n-1). | |
28 ## @end ifinfo | |
29 ## | |
30 ## If @var{x} is a matrix, @code{diff (@var{x})} is the matrix of column | |
24 ## differences. | 31 ## differences. |
32 ## | |
33 ## The second argument is optional. If supplied, @code{diff (@var{x}, | |
34 ## @var{k})}, where @var{k} is a nonnegative integer, returns the | |
35 ## @var{k}-th differences. | |
36 ## @end deftypefn | |
25 | 37 |
26 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> | 38 ## Author: KH <Kurt.Hornik@ci.tuwien.ac.at> |
27 ## Created: 2 February 1995 | 39 ## Created: 2 February 1995 |
28 ## Adapted-By: jwe | 40 ## Adapted-By: jwe |
29 | 41 |