comparison scripts/plot/hist.m @ 5065:1312d3af9eb0

[project @ 2004-11-04 20:12:00 by jwe]
author jwe
date Thu, 04 Nov 2004 20:12:11 +0000
parents c08cb1098afc
children 4c8a2e4e0717
comparison
equal deleted inserted replaced
5064:a6755bc45f15 5065:1312d3af9eb0
48 48
49 if (nargin < 1 || nargin > 3) 49 if (nargin < 1 || nargin > 3)
50 usage ("[nn, xx] = hist (y, x, norm)"); 50 usage ("[nn, xx] = hist (y, x, norm)");
51 endif 51 endif
52 52
53 transpose = rows (y) == 1; 53 arg_is_vector = is_vector (y);
54 if (transpose) 54
55 if (rows (y) == 1)
55 y = y(:); 56 y = y(:);
56 endif 57 endif
57 58
58 if (isreal (y)) 59 if (isreal (y))
59 max_val = max (y); 60 max_val = max (y);
117 ## Normalise the histogram. 118 ## Normalise the histogram.
118 freq = freq / rows (y) * norm; 119 freq = freq / rows (y) * norm;
119 endif 120 endif
120 121
121 if (nargout > 0) 122 if (nargout > 0)
122 if (transpose) 123 if (arg_is_vector)
123 nn = freq'; 124 nn = freq';
124 xx = x'; 125 xx = x';
125 else 126 else
126 nn = freq; 127 nn = freq;
127 xx = x; 128 xx = x;