diff.m

来自「实现地震勘探中」· M 代码 · 共 40 行

M
40
字号
function ds=diff(ds,n,dim)% Function computes the sample-to-sample difference of the traces of a seismic dataset% See help for Matlab function "diff". Start and/or end times are changed in accordance% with the setting of "S4M.diff_location".%% Written by: E. R.: November 4, 2006% Last updated:%%        ds=diff(ds)global S4Mif nargin <= 2   dim=1;endif nargin == 1   n=1;endif isstruct(ds)  &&  strcmp(ds(1).type,'seismic')   for ii=1:numel(ds)      ds(ii).traces=diff(ds(ii).traces,n,dim);   end   switch S4M.diff_location   case 'base'      ds(ii).last=ds(ii).last-n*ds(ii).step;   case 'top'      ds(ii).first=ds(ii).first+n*ds(ii).step;   case  'center'      ds(ii).first=ds(ii).first+0.5*n*ds(ii).step;      ds(ii).last=ds(ii).last-0.5*n*ds(ii).step;   otherwise      error(['Unknown option "S4M.diff_location": ',S4M.diff_location])   endelse   error('Function "diff" is not defined for this argument class.')end

⌨️ 快捷键说明

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