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

📄 l_depth2index.m

📁 matlab源代码
💻 M
字号:
function wlog=l_depth2index(wlog,warn)
% Prepend a new column to the log curves. This curve is an index vector
% with values increasing from 1 to "nsamp", the number of rows of the curve
% matrix. It becomes the new depth curve. The original depth curve is now a 
% curve like any other curve. The mnemonic of the new curve is "row_index".
% If a curve with this name already exists and "warn" is set to 1 a warning 
% message pops up and the user is given the opportunity to overwrite it or 
% abort. Otherwise it is silently overwritten.
% Written by: E. R.: August 4, 2003
% Last updated: September 16, 2003: change mnemonic name to "row_index"
%
%         wlog=l_depth2index(wlog)
% INPUT
% wlog    well log
% warn    issue warning if index already exists. Two possible values: 
%         1 (yes) and  0 (no).
%         Default: warn=logical(0)
% OUTPUT
% wlog    original well log with prepended curve "row_index"

if nargin == 1
   warn=logical(0);
end

index=find(ismember(wlog.curve_info,'row_index'));
if ~isempty(index) & warn
   ButtonName=questdlg('The mnemonic "row_index" alredy exists. Do you want to replace it?', ...
                       'SeisLab Message from "l_depth2index"', ...
                       'yes','no','no');
   if strcmp(ButtonName,'no')
      disp(' The mnemonic "row_index" alredy exists.')
      error('Abnormal termination')
   end
   wlog=l_curve(wlog,'delete','row_index');
elseif ~isempty(index)
   wlog=l_curve(wlog,'delete','row_index');
end

nsamp=size(wlog.curves,1);
wlog.curves=[(1:nsamp)',wlog.curves];
wlog.curve_info=[{'row_index','n/a','Row index'};wlog.curve_info];
wlog.first=1;
wlog.last=nsamp;
wlog.step=1;

⌨️ 快捷键说明

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