comparison toolboxes/FullBNT-1.0.7/netlab3.3/histp.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function h = histp(x, xmin, xmax, nbins)
2 %HISTP Histogram estimate of 1-dimensional probability distribution.
3 %
4 % Description
5 %
6 % HISTP(X, XMIN, XMAX, NBINS) takes a column vector X of data values
7 % and generates a normalized histogram plot of the distribution. The
8 % histogram has NBINS bins lying in the range XMIN to XMAX.
9 %
10 % H = HISTP(...) returns a vector of patch handles.
11 %
12 % See also
13 % DEMGAUSS
14 %
15
16 % Copyright (c) Ian T Nabney (1996-2001)
17
18 ndata = length(x);
19
20 bins = linspace(xmin, xmax, nbins);
21
22 binwidth = (xmax - xmin)/nbins;
23
24 num = hist(x, bins);
25
26 num = num/(ndata*binwidth);
27
28 h = bar(bins, num, 0.6);
29