Code covered by the BSD License  

Highlights from
Seis_Pick

image thumbnail

Seis_Pick

by

 

06 Feb 2012 (Updated )

Seis_Pick provides an interactive picking environment for processing seismic data.

[int,iint]=get_integer(stringarg,keywd)
function [int,iint]=get_integer(stringarg,keywd)
% function [int,iint]=get_integer(stringarg,keywd)
%
% e.g., [int,iint]=get_integer(stringarg,'components')
%
% Returns integer arguments from the larger input string
% 'iint' is 1 if argument can be found, 0 if it cannot
%
% J.P. Verdon, UoB, 2011
%

iint=0;
for i=length(keywd)+1:length(stringarg)
     if strcmp(stringarg(i),'=') == 1
         wd=[stringarg(i-length(keywd):i-1)];
         if strcmp(wd,keywd) == 1
             iint=1;
             for j=1:30
                 if i+j > length(stringarg)
                     break
                 end
                 tl=stringarg(i+j);
                 if strcmp(tl,' ') ~= 1
                     string(j)=tl;
                 else
                     break
                 end
             end
         end
     end
end
if iint == 1
    int=str2num(string);
else
    int=-1;
end


Contact us