s_get_extrema.m

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

M
38
字号
function [values,times,index]=s_get_extrema(seismic,option)% Determine, for each trace, the value of the requested trace extremum and % the time and the sample index where they occur for the first time.%% Written by: E. R.: May 8, 2006% Last updated: %%          [values,times,index]=s_get_extrema(seismic,option)% INPUT% seismic  seismic dataset% option   string indicating typ of extremum; possible values are 'max','min'% OUTPUT% values   row vector with the values of the extrema (one for each trace)% times    row vector with the times where the first extreme value occurs on %          each trace% index    row vector of sample indices of the extreme values%% EXAMPLE%    seismic=s_data;%    [values,times]=s_get_extrema(seismic,'max');%    disp(values),%    disp(times)switch optioncase 'max'   [values,index]=max(seismic.traces);case 'min'   [values,index]=min(seismic.traces);otherwise   error('Unknown option.')endtimes=(index-1)*seismic.step+seismic.first;

⌨️ 快捷键说明

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