1014
|
1 # Copyright (C) 1994, 1995 John W. Eaton |
933
|
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 the |
|
7 # Free Software Foundation; either version 2, or (at your option) any |
|
8 # later version. |
|
9 # |
|
10 # Octave is distributed in the hope that it will be useful, but WITHOUT |
|
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
12 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
13 # for more details. |
|
14 # |
|
15 # You should have received a copy of the GNU General Public License |
|
16 # along with Octave; see the file COPYING. If not, write to the Free |
|
17 # Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
18 |
|
19 function plot_int_1 (x1, fmt) |
|
20 |
|
21 if (nargin < 1 || nargin > 2) |
|
22 usage ("plot_int_1 (x1, fmt)"); |
|
23 endif |
|
24 |
|
25 if (nargin == 1) |
|
26 fmt = ""; |
|
27 endif |
|
28 |
|
29 if (! isstr (fmt)) |
|
30 error ("plot_int_1: fmt must be a string"); |
|
31 endif |
|
32 |
|
33 [nr, nc] = size (x1); |
|
34 if (nr == 1) |
|
35 x1 = x1'; |
|
36 tmp = nr; |
|
37 nr = nc; |
|
38 nc = tmp; |
|
39 endif |
|
40 x1_i = imag (x1); |
|
41 if (any (any (x1_i))) |
|
42 x2 = x1_i; |
|
43 x1 = real (x1); |
|
44 else |
|
45 x2 = x1; |
|
46 x1 = (1:nr)'; |
|
47 endif |
|
48 |
|
49 plot_int_2 (x1, x2, fmt); |
|
50 |
|
51 endfunction |