function [M] = matchpercent(value, logdata, percent) % [M] = matchpercent(VALUE, VECTOR, PERCENT) % % MATCHPERCENT is called by CORELOGINTEGRATE. % It takes a single density VALUE (1x6 vector with the following % columns: 1 depth, 2 density, 3 core, 4 section, 5, piece, 6 depth from % top of section) from GRA data and compares it to a VECTOR (2 columns: 1 % depth, 2 density) of possible depths and corresponding log density to % find all of the depths that are within a certain PERCENT (as a decimal) % of the value. % [M] is a 8 column matrix: 1 log depth, 2 log density, 3 curated depth, % 4 GRA density, 5 core, 6 section, 7 piece, 8 distance from top of section % ------------------------------------------------------------------------- % % Gilbert, L.A. and A. Burke, 2008, Depth-shifting cores % incompletely recovered from the upper oceanic crust, IODP Hole 1256D, % G-cubed, 2008gc002010. % % Revised 5/8/08, AB and LAG % for further information contact aburke@mit.edu or lgilbert@williams.edu delta = percent*value(1,2); index = find(logdata(:,2) >= value(1,2)-delta & logdata(:,2) <= value(1,2) + delta); if not(isempty(index)) M= [logdata(index,1) logdata(index,2)]; else M = [-999.99 -999.99]; end M(:,3) = value(1,1); %curated depth M(:,4) = value(1,2); %GRA density M(:,5) = value(1,3); %core M(:,6) = value(1,4); %section M(:,7) = value(1,5); %piece M(:,8) = value(1,6); %dist from top of section