depths2step_with_checking.m

来自「基于Matlab的地震数据处理显示和测井数据显示于处理的小程序」· M 代码 · 共 45 行

M
45
字号
function step=depths2step_with_checking(depths,epsilon)% Compute sample increment for well logs%% Written by: E. R.: April 18, 2006% Last updated:%%          step=depths2step_with_checking(depths,epsilon)% INPUT% depths   vector of monotonically increasing depth values% epsilon  maximum relative change increment from one depth value to the next%          Default: epsilon = S4M.log_step_error% OUTPUT% step     depth increment or zero if%          abs(max(diff(depths))/median(diff(depths))-1 < epsilonglobal S4Mif nargin == 1   epsilon=S4M.log_step_error;endnsamp=length(depths);if nsamp == 1   step=0;elseif nsamp == 2   step=depths(2)-depths(1);   if step < 0      error(' The selected "depth column" is decreasing.')   elseif step == 0      error('The two depth samples are identical.')   endelse   dd=diff(depths);   if any(dd <= 0)      error(' The selected "depth column" is not strictly monotonic.')   end   mdd=mean(dd);   if isnearinteger(max(dd)/mdd,epsilon)      step=mdd;   else      step=0;   endend

⌨️ 快捷键说明

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