⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 histo.m

📁 patten regnization source从1-14章能运行
💻 M
字号:
function [xb1,p1]=histo(x,binwidth,shift,par)% ----------------------------------------------------------------% function [xb1,p1]=histo(x,binwidth,shift,'par') % ----------------------------------------------------------------% the histogram with different bandwidth and sideway shift values% Hint: the choise shift=bandwidth/2 places bin edges at the origin % ------------------------------------------------------------------% INPUT%  x          data, a row vector %  binwidth   the binwidth  %  shift      the amount of sideway shift%  'par'      the plot parameter  for example 'r--'% OUTPUT%  xb1        bin centers xb(i) center of bin_i%  p1         bin propotions p(i)  %-------------------------------------------------------------------xmax=max(x);xmin=min(x);alaraja=floor(xmin/binwidth)*binwidth;ylaraja=ceil(xmax/binwidth)*binwidth;nbin=(ylaraja-alaraja)/binwidth;    % the number of binsind=(0:nbin-1);xb1=binwidth*ind+alaraja+shift;         % the bincentersp1=hist(x,xb1)/(length(x)*binwidth);    % the bin propotions xb=[xb1-binwidth/2;xb1;xb1+binwidth/2];xb=xb(:)';p=[p1;p1;p1];p=p(:)';xb=[min(xb),xb,max(xb)];p=[0,p,0];plot(xb,p,par)

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -