pp_edges_from_samples.m
来自「地震、测井方面matlab代码,解释的比较详细」· M 代码 · 共 26 行
M
26 行
function edges=pp_edges_from_samples(samples,nedges)
% Create edge vector from sample vector for histogram computation
% Written by: E. R.: June 26, 2003
% Last updated: July, 30, 2003: Change order of input arguments
%
% edges=pp_edges_from_samples(samples,nedges)
% INPUT
% samples samples from which to compute the edges
% nedges number of edges (number of bins for histogram +1)
% OUTPUT
% edges column vector of edges of histogram bins
sampleMin=min(samples(:));
sampleMax=max(samples(:));
if sampleMax >= 0
sampleMax=sampleMax*(1+2*eps);
else
sampleMax=sampleMax*(1-2*eps);
end
if sampleMin*sampleMax < 0;
sampleMax=max(-sampleMin,sampleMax);
sampleMin=-sampleMax;
end
edges=linspace(sampleMin,sampleMax,nedges)';
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?