7017
|
1 ## Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007 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 |
6895
|
19 ## Undocumented internal function. |
4019
|
20 |
|
21 ## Created: 20.02.2001 |
|
22 ## Author: Teemu Ikonen <tpikonen@pcu.helsinki.fi> |
|
23 ## Keywords: errorbar, plotting |
|
24 |
6404
|
25 function retval = __errcomm__ (caller, p, varargin) |
4019
|
26 |
6257
|
27 if (nargin < 4) |
|
28 print_usage (); |
4019
|
29 endif |
|
30 |
4897
|
31 nargs = length (varargin); |
6257
|
32 |
|
33 k = 1; |
6302
|
34 idx = 1; |
6257
|
35 data = cell(6,1); |
|
36 while (k <= nargs) |
|
37 a = varargin{k++}; |
|
38 if (isvector (a)) |
|
39 a = a(:); |
|
40 elseif (ismatrix (a)) |
|
41 ; |
|
42 else |
|
43 usage ("%s (...)", caller); |
4019
|
44 endif |
6257
|
45 sz = size (a); |
|
46 ndata = 1; |
|
47 data{ndata} = a; |
4897
|
48 while (k <= nargs) |
4019
|
49 a = varargin{k++}; |
6257
|
50 if (ischar (a) || iscellstr (a)) |
6404
|
51 retval(idx++) = __errplot__ (a, p, data{1:ndata}); |
6257
|
52 break; |
|
53 elseif (isvector (a)) |
|
54 a = a(:); |
4030
|
55 elseif (ismatrix (a)) |
6257
|
56 ; |
4019
|
57 else |
6257
|
58 error ("wrong argument types"); |
|
59 endif |
|
60 if (size (a) != sz) |
|
61 error ("argument sizes do not match"); |
4019
|
62 endif |
6257
|
63 data{++ndata} = a; |
|
64 if (ndata > 6) |
|
65 error ("too many arguments to a plot"); |
|
66 endif |
4019
|
67 endwhile |
6257
|
68 endwhile |
4019
|
69 |
6257
|
70 if (! (ischar (a) || iscellstr (a))) |
6404
|
71 retval(idx++) = __errplot__ ("~", p, data{1:ndata}); |
6257
|
72 endif |
|
73 |
|
74 drawnow (); |
4019
|
75 |
|
76 endfunction |