Mercurial > hg > octave-lyh
annotate scripts/general/colon.m @ 17380:63b53ea33a8b
imread: fix returning multiple variables.
* imread.m: fix mistake when filling varargout from cset. Do not miss
the first cell.
* __magick_read__.cc (read_maps): change class of alpha map which is
only a column vector, not a Nx3 Matrix.
author | Carnë Draug <carandraug@octave.org> |
---|---|
date | Wed, 04 Sep 2013 21:22:43 +0100 |
parents | 1c89599167a6 |
children |
rev | line source |
---|---|
14138
72c96de7a403
maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents:
12795
diff
changeset
|
1 ## Copyright (C) 2008-2012 David Bateman |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
2 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
4 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
8 ## your option) any later version. |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
9 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
13 ## General Public License for more details. |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
14 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
18 |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
10793
be55736a0783
Grammarcheck the documentation from m-files.
Rik <octave@nomad.inbox5.com>
parents:
9245
diff
changeset
|
20 ## @deftypefn {Function File} {@var{r} =} colon (@var{a}, @var{b}) |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
21 ## @deftypefnx {Function File} {@var{r} =} colon (@var{a}, @var{b}, @var{c}) |
9051
1bf0ce0930be
Grammar check TexInfo in all .m files
Rik <rdrider0-list@yahoo.com>
parents:
8221
diff
changeset
|
22 ## Method of a class to construct a range with the @code{:} operator. For |
10821
693e22af08ae
Grammarcheck documentation of m-files
Rik <octave@nomad.inbox5.com>
parents:
10793
diff
changeset
|
23 ## example: |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
24 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
25 ## @example |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
26 ## @group |
14327
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
27 ## a = myclass (@dots{}); |
4d917a6a858b
doc: Use Octave coding conventions in @example blocks of docstrings.
Rik <octave@nomad.inbox5.com>
parents:
14138
diff
changeset
|
28 ## b = myclass (@dots{}); |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
29 ## c = a : b |
8221
06094fa570a3
Add some documentation for the OOP code of Octave
David Bateman <dbateman@free.fr>
parents:
8213
diff
changeset
|
30 ## @end group |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
31 ## @end example |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
32 ## |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
33 ## @seealso{class, subsref, subsasgn} |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
34 ## @end deftypefn |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
35 |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
36 function r = colon (varargin) |
12718
01980844dc9c
colon.m: Stop issuing error if called accidentally with no arguments.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
37 if (nargin != 0) |
14870
6e04750eaffb
maint: Use single quotes to simplify backslashing of double quotes.
Rik <octave@nomad.inbox5.com>
parents:
14868
diff
changeset
|
38 error ('colon: not defined for class "%s"', class (varargin{1})); |
12718
01980844dc9c
colon.m: Stop issuing error if called accidentally with no arguments.
Rik <octave@nomad.inbox5.com>
parents:
11523
diff
changeset
|
39 endif |
8213
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
40 endfunction |
12795
9e7ebbaf69ff
codesprint: new tests for files in scripts/general directory
John W. Eaton <jwe@octave.org>
parents:
12718
diff
changeset
|
41 |
14363
f3d52523cde1
Use Octave coding conventions in all m-file %!test blocks
Rik <octave@nomad.inbox5.com>
parents:
14327
diff
changeset
|
42 |
12795
9e7ebbaf69ff
codesprint: new tests for files in scripts/general directory
John W. Eaton <jwe@octave.org>
parents:
12718
diff
changeset
|
43 %!error colon (1) |
9e7ebbaf69ff
codesprint: new tests for files in scripts/general directory
John W. Eaton <jwe@octave.org>
parents:
12718
diff
changeset
|
44 |
9e7ebbaf69ff
codesprint: new tests for files in scripts/general directory
John W. Eaton <jwe@octave.org>
parents:
12718
diff
changeset
|
45 ## FIXME -- what does colon () mean since it doesn't set a return value? |
17346
1c89599167a6
maint: End m-files with 1 blank line.
Rik <rik@octave.org>
parents:
14870
diff
changeset
|
46 |