hfill
PURPOSE 
[bincenter,n] = hfill(vals,nbin,low,high,weight,opt)
SYNOPSIS 
function [bincenter,n] = hfill(vals,nbin,low,high,weights,opt)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
- hfill [bincenter,n] = hfill(vals,nbin,low,high,weight,opt)
- hplot hplot(bc,n,opt,lim)
This function is called by:
- hfill [bincenter,n] = hfill(vals,nbin,low,high,weight,opt)
- mosaic_map_plot [moss,mosl]=mosaic_map_plot(ad,ads,o,p,beam,mrk)
SOURCE CODE 
0001 function [bincenter,n] = hfill(vals,nbin,low,high,weights,opt)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 if(isempty(vals))
0019 error('Must provide data to histogram');
0020 end
0021
0022 if(~exist('nbin'))
0023 nbin=[];
0024 end
0025 if(~exist('low'))
0026 low=[];
0027 end
0028 if(~exist('high'))
0029 high=[];
0030 end
0031 if(~exist('weights'))
0032 weights=[];
0033 end
0034 if(~exist('opt'))
0035 opt=' ';
0036 end
0037
0038
0039 if(isempty(weights))
0040 weights=ones(size(vals));
0041 end
0042
0043 if((~isreal(vals))|(~isreal(weights)))
0044 error('Data (and weights) must be real');
0045 end
0046
0047
0048 vals=vals(:)'; weights=weights(:)';
0049
0050 if(isempty(nbin))
0051 nbin=10;
0052 end
0053 if(isempty(low))
0054 low=min(vals);
0055 end
0056 if(isempty(high))
0057 high=max(vals);
0058
0059 high=high+(high-low)*1e-9;
0060 end
0061
0062
0063 if(sum(~isfinite(vals))>0)
0064 ind=isfinite(vals);
0065 vals=vals(ind);
0066 weights=weights(ind);
0067 warning('Non-finite input data (removed)');
0068 end
0069
0070 [bincenter,n]=hfill(vals,nbin,low,high,weights);
0071
0072
0073
0074 if(nargout==0)
0075 hplot(bincenter,n,opt);
0076 end
Generated on Sun 14-Jun-2015 17:12:45 by m2html © 2005