0001 function [no,xo] = hist_dke_yp(y,x,xlabelmode,ylabelmode,titlemode,xlimmode,ylimmode,colormode,linemode,widthmode)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 if nargin == 0
0023 error('Requires one or two input arguments.')
0024 end
0025 if nargin == 1
0026 x = 10;
0027 end
0028 if min(size(y))==1, y = y(:); end
0029 if isstr(x) | isstr(y)
0030 error('Input arguments must be numeric.')
0031 end
0032 [m,n] = size(y);
0033 if max(size(x)) == 1
0034 return;
0035 miny = min(min(y));
0036 maxy = max(max(y));
0037 binwidth = (maxy - miny) ./ x;
0038 xx = miny + binwidth*[0:x];
0039 xx(length(xx)) = maxy;
0040 x = xx(1:length(xx)-1) + binwidth/2;
0041 else
0042 xx = x(:)';
0043 xx0 = xx;
0044 miny = min(min(y));
0045 maxy = max(max(y));
0046 binwidth = [diff(xx) 0];
0047
0048 xx(1) = miny;
0049 xx(length(xx)) = maxy;
0050 end
0051 nbin = max(size(xx));
0052 nn = zeros(nbin,n);
0053 for i=2:nbin
0054 nn(i,:) = sum(y <= xx(i));
0055 end
0056 nn = nn(2:nbin,:) - nn(1:nbin-1,:);
0057 if nargout == 0
0058 stairs_dke_yp(xx0,[nn',nn(length(nn))],xlabelmode,ylabelmode,titlemode,xlimmode,ylimmode,colormode,linemode,widthmode,0);
0059 else
0060 if min(size(y))==1,
0061 no = nn';
0062 xo = x;
0063 else
0064 no = nn;
0065 xo = x';
0066 end
0067 end