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

📄 header_index1.m

📁 实现地震勘探中
💻 M
字号:
function [index,ier]=header_index1(seismic,mnem,abort)% Function outputs index of header in seismic structure "seismic".% If no header mnemonic is found matching "mnem" then "index" is []%%         [index,ier]=header_index1(seismic,mnem)% INPUT% seismic  seismic structure whose headers are requested% mnem   header mnemonics% abort  optional parameter indicating if function should terminate abnormally%        if no or two or more mnemonics are found%        abort = 0 ==> do not terminate abnormally (default for two output arguments)%        abort = 1 ==> terminate abnormally  (default for one output argument)% OUTPUT% index  index of header with mnemonic "mnem"% ier    error indicator; If only one output argument is given, the function will abort%        with an error message if no header or more than one header is found%        Otherwise: ier=0 if no error was detected and ier=1 if an error was found     global S4Mif nargin < 3    if nargout == 1      abort=1;   else      abort=0;   endendif S4M.case_sensitive   index=find(ismember(seismic.header_info(:,1),mnem));else   index=find(ismember(lower(seismic.header_info(:,1)),lower(mnem)));end%       Check for errorsif nargout < 2    if isempty(index)  &&  abort ~= 0    % Print error message      disp([' Header with mnemonic  "',mnem,'" not found'])      disp(' The following header mnemonics exist: ')      disp(seismic.header_info(:,1)');      error(' Abnormal termination')   elseif length(index) > 1  &&  abort ~= 0    % Print error message      disp([' More than one header with mnemonic "',mnem,'" found.'])      disp(' The following header mnemonics exist: ')      disp(seismic.header_info(:,1)');      error(' Abnormal termination')   else     return   endelse   if isempty(index) || length(index) > 1      ier=1;   else      ier=0;   endend

⌨️ 快捷键说明

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