正在加载图片...
function Th, hn, xspan]=hist(data, xO, binsize, xf) ZHISTN Normalized Histogram l [H, HN, XSPAN]= HISTN (DATA, XO, BINSIZE, XF) generates the normalized istogram of area 1 from the values in DATA which are binned into h with a bin width specified by BINSIZE. region from Xo to XF h equally spaced containers that span the XO. BINSIZE and XF are all scalars while data is a vector H, HN and XsPAN are equally sized vectors %%%%%%%% References [1] Alan Edelman, Handout 2: Histogramming Fall 2004. Course Notes 18.338 [2]A1a elman, Random Matrix Eigenvalues Alan Edelman and Raj Rao, Sept. 2004 Revision:1.1$$Date:2004/09/1017:11:18$ aspan=Lxo: binsize: xf]; h=hist(data, span) 7 Generate histogram hn=h/(length (data)*binsize); l Normalize histogram to have area 1 bar (span, hn) 7 Plot histogram We will use this code throughout the remainder of the course to corroborate theoretical predictions with� � � � function [h,hn,xspan]=histn(data,x0,binsize,xf); %HISTN Normalized Histogram. % [H,HN,XSPAN] = HISTN(DATA,X0,BINSIZE,XF) generates the normalized % histogram of area 1 from the values in DATA which are binned into % equally spaced containers that span the region from X0 to XF % with a bin width specified by BINSIZE. % % X0, BINSIZE and XF are all scalars while DATA is a vector. % H, HN and XSPAN are equally sized vectors. % % References: % [1] Alan Edelman, Handout 2: Histogramming, % Fall 2004, Course Notes 18.338. % [2] Alan Edelman, Random Matrix Eigenvalues. % % Alan Edelman and Raj Rao, Sept. 2004. % $Revision: 1.1 $ $Date: 2004/09/10 17:11:18 $ xspan=[x0:binsize:xf]; h=hist(data,xspan); % Generate histogram hn=h/(length(data)*binsize); % Normalize histogram to have area 1 bar(xspan,hn); % Plot histogram Code 2 We will use this code throughout the remainder of the course to corroborate theoretical predictions with experimental data
<<向上翻页
©2008-现在 cucdc.com 高等教育资讯网 版权所有