Mercurial > hg > octave-lyh
annotate scripts/general/colon.m @ 11188:4cb1522e4d0f
Use function handle as input to cellfun,
rather than quoted function name or anonymous function wrapper.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Wed, 03 Nov 2010 17:20:56 -0700 |
parents | 693e22af08ae |
children | fd0a3ac60b0e |
rev | line source |
---|---|
9245 | 1 ## Copyright (C) 2008, 2009 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 |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
27 ## a = myclass (@dots{}) |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
28 ## b = myclass (@dots{}) |
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) |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
37 error ("colon: not defined for class \"%s\"", class(varargin{1})); |
d5e08881bba8
Add overloading of the colon operator
David Bateman <dbateman@free.fr>
parents:
diff
changeset
|
38 endfunction |