4
|
1 function plot_int (x1, x2) |
|
2 |
|
3 if (nargin == 1) |
|
4 [nr, nc] = size (x1); |
|
5 if (nr == 1) |
|
6 x1 = x1'; |
|
7 tmp = nr; |
|
8 nr = nc; |
|
9 nc = tmp; |
|
10 endif |
|
11 x1_i = imag (x1); |
|
12 if (x1_i) |
|
13 x2 = x1_i; |
|
14 x1 = real (x1); |
|
15 else |
|
16 x2 = x1; |
|
17 x1 = (1:nr)'; |
|
18 endif |
|
19 endif |
|
20 |
|
21 if (nargin <= 2) |
|
22 if (imag (x1)) |
|
23 x1 = real (x1); |
|
24 endif |
|
25 if (imag (x2)) |
|
26 x2 = real (x2); |
|
27 endif |
|
28 if (is_scalar (x1)) |
|
29 if (is_scalar (x2)) |
|
30 plot_2_s_s (x1, x2); |
|
31 endif |
|
32 elseif (is_vector (x1)) |
|
33 if (is_vector (x2)) |
|
34 plot_2_v_v (x1, x2); |
|
35 elseif (is_matrix (x2)) |
|
36 plot_2_v_m (x1, x2); |
|
37 endif |
|
38 elseif (is_matrix (x1)) |
|
39 if (is_vector (x2)) |
|
40 plot_2_m_v (x1, x2); |
|
41 elseif (is_matrix (x2)) |
|
42 plot_2_m_m (x1, x2); |
|
43 endif |
|
44 endif |
|
45 else |
|
46 usage = sprintf ("usage: plot_int (x)\n"); |
|
47 usage = sprintf ("%s plot_int (x, y)", usage); |
|
48 error (usage); |
|
49 endif |
|
50 |
|
51 endfunction |