Mercurial > hg > octave-lyh
annotate scripts/plot/__errcomm__.m @ 9111:96e7a72be5e7
typo
author | David Bateman <dbateman@free.fr> |
---|---|
date | Sun, 12 Apr 2009 11:08:56 +0200 |
parents | eb63fbe60fab |
children |
rev | line source |
---|---|
8920 | 1 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2009 Teemu Ikonen |
4019 | 2 ## |
3 ## This file is part of Octave. | |
4 ## | |
5 ## Octave is free software; you can redistribute it and/or modify it | |
6 ## under the terms of the GNU General Public License as published by | |
7016 | 7 ## the Free Software Foundation; either version 3 of the License, or (at |
8 ## your option) any later version. | |
4019 | 9 ## |
10 ## Octave is distributed in the hope that it will be useful, but | |
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 ## General Public License for more details. | |
14 ## | |
15 ## You should have received a copy of the GNU General Public License | |
7016 | 16 ## along with Octave; see the file COPYING. If not, see |
17 ## <http://www.gnu.org/licenses/>. | |
4019 | 18 |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
19 ## -*- texinfo -*- |
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
20 ## @deftypefn {Function File} {} __errcomm__ (@var{caller}, @var{p}, @dots{}) |
6895 | 21 ## Undocumented internal function. |
8812
7d48766c21a5
use consistent format for doc strings of internal functions
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
22 ## @end deftypefn |
4019 | 23 |
24 ## Created: 20.02.2001 | |
25 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> | |
26 ## Keywords: errorbar, plotting | |
27 | |
6404 | 28 function retval = __errcomm__ (caller, p, varargin) |
4019 | 29 |
6257 | 30 if (nargin < 4) |
31 print_usage (); | |
4019 | 32 endif |
33 | |
4897 | 34 nargs = length (varargin); |
6257 | 35 |
36 k = 1; | |
6302 | 37 idx = 1; |
6257 | 38 data = cell(6,1); |
39 while (k <= nargs) | |
40 a = varargin{k++}; | |
41 if (isvector (a)) | |
42 a = a(:); | |
43 elseif (ismatrix (a)) | |
44 ; | |
45 else | |
46 usage ("%s (...)", caller); | |
4019 | 47 endif |
6257 | 48 sz = size (a); |
49 ndata = 1; | |
50 data{ndata} = a; | |
4897 | 51 while (k <= nargs) |
4019 | 52 a = varargin{k++}; |
6257 | 53 if (ischar (a) || iscellstr (a)) |
6404 | 54 retval(idx++) = __errplot__ (a, p, data{1:ndata}); |
6257 | 55 break; |
56 elseif (isvector (a)) | |
57 a = a(:); | |
4030 | 58 elseif (ismatrix (a)) |
6257 | 59 ; |
4019 | 60 else |
6257 | 61 error ("wrong argument types"); |
62 endif | |
63 if (size (a) != sz) | |
64 error ("argument sizes do not match"); | |
4019 | 65 endif |
6257 | 66 data{++ndata} = a; |
67 if (ndata > 6) | |
68 error ("too many arguments to a plot"); | |
69 endif | |
4019 | 70 endwhile |
6257 | 71 endwhile |
4019 | 72 |
6257 | 73 if (! (ischar (a) || iscellstr (a))) |
6404 | 74 retval(idx++) = __errplot__ ("~", p, data{1:ndata}); |
6257 | 75 endif |
76 | |
77 drawnow (); | |
4019 | 78 |
79 endfunction |