annotate scripts/statistics/base/range.m @ 10793:be55736a0783

Grammarcheck the documentation from m-files.
author Rik <octave@nomad.inbox5.com>
date Sun, 18 Jul 2010 20:35:16 -0700
parents 5fb7e17281e8
children e151e23f73bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
1 ## Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2004, 2005, 2006,
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
2 ## 2007 Kurt Hornik
9160
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
3 ## Copyright (C) 2009 Jaroslav Hajek
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
4 ##
3922
38c61cbf086c [project @ 2002-05-01 06:48:35 by jwe]
jwe
parents: 3456
diff changeset
5 ## This file is part of Octave.
38c61cbf086c [project @ 2002-05-01 06:48:35 by jwe]
jwe
parents: 3456
diff changeset
6 ##
38c61cbf086c [project @ 2002-05-01 06:48:35 by jwe]
jwe
parents: 3456
diff changeset
7 ## Octave is free software; you can redistribute it and/or modify it
38c61cbf086c [project @ 2002-05-01 06:48:35 by jwe]
jwe
parents: 3456
diff changeset
8 ## under the terms of the GNU General Public License as published by
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
9 ## the Free Software Foundation; either version 3 of the License, or (at
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
10 ## your option) any later version.
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
11 ##
3922
38c61cbf086c [project @ 2002-05-01 06:48:35 by jwe]
jwe
parents: 3456
diff changeset
12 ## Octave is distributed in the hope that it will be useful, but
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
13 ## WITHOUT ANY WARRANTY; without even the implied warranty of
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
14 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
15 ## General Public License for more details.
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
16 ##
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
17 ## You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
18 ## along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 6046
diff changeset
19 ## <http://www.gnu.org/licenses/>.
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
20
3453
71d2e09c15a2 [project @ 2000-01-18 08:32:09 by jwe]
jwe
parents: 3426
diff changeset
21 ## -*- texinfo -*-
10793
be55736a0783 Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents: 9193
diff changeset
22 ## @deftypefn {Function File} {} range (@var{x})
4848
8122518935e4 [project @ 2004-04-06 15:15:44 by jwe]
jwe
parents: 4847
diff changeset
23 ## @deftypefnx {Function File} {} range (@var{x}, @var{dim})
3453
71d2e09c15a2 [project @ 2000-01-18 08:32:09 by jwe]
jwe
parents: 3426
diff changeset
24 ## If @var{x} is a vector, return the range, i.e., the difference
71d2e09c15a2 [project @ 2000-01-18 08:32:09 by jwe]
jwe
parents: 3426
diff changeset
25 ## between the maximum and the minimum, of the input data.
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
26 ##
3453
71d2e09c15a2 [project @ 2000-01-18 08:32:09 by jwe]
jwe
parents: 3426
diff changeset
27 ## If @var{x} is a matrix, do the above for each column of @var{x}.
4847
83ddfedb8db7 [project @ 2004-04-02 21:15:34 by jwe]
jwe
parents: 3922
diff changeset
28 ##
83ddfedb8db7 [project @ 2004-04-02 21:15:34 by jwe]
jwe
parents: 3922
diff changeset
29 ## If the optional argument @var{dim} is supplied, work along dimension
83ddfedb8db7 [project @ 2004-04-02 21:15:34 by jwe]
jwe
parents: 3922
diff changeset
30 ## @var{dim}.
3453
71d2e09c15a2 [project @ 2000-01-18 08:32:09 by jwe]
jwe
parents: 3426
diff changeset
31 ## @end deftypefn
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
32
5428
2a16423e4aa0 [project @ 2005-08-23 18:38:27 by jwe]
jwe
parents: 5307
diff changeset
33 ## Author: KH <Kurt.Hornik@wu-wien.ac.at>
3456
434790acb067 [project @ 2000-01-19 06:58:51 by jwe]
jwe
parents: 3453
diff changeset
34 ## Description: Compute range
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
35
9160
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
36 function y = range (x, dim)
3426
f8dde1807dee [project @ 2000-01-13 08:40:00 by jwe]
jwe
parents: 3200
diff changeset
37
9160
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
38 if (nargin == 1)
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
39 y = max (x) - min (x);
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
40 elseif (nargin == 2)
9193
5fb7e17281e8 really fix the bug in range
Jaroslav Hajek <highegg@gmail.com>
parents: 9160
diff changeset
41 y = max (x, [], dim) - min (x, [], dim);
9160
11e0f0e8ff00 fix range
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
42 else
6046
34f96dd5441b [project @ 2006-10-10 16:10:25 by jwe]
jwe
parents: 5428
diff changeset
43 print_usage ();
3200
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
44 endif
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
45
781c930425fd [project @ 1998-10-29 05:23:08 by jwe]
jwe
parents:
diff changeset
46 endfunction