% ***************************************************************** % *** Depth estimation of dike-like magnetic bodies *** % *** Coded by Yunus Levent Ekinci June 2016 *** % *** Tested using Matlab R2012b under Windows 8.1 *** % *** Method of Abdelrahman and Abo-Ezz (2001) *** % *** Geophysics, 66 (1), 205-212 *** % ***************************************************************** % *** ylekinci@beu.edu.tr *** % *** ylekinci@yahoo.com *** % *** http://pbs.beu.edu.tr/ylekinci *** % *** Bitlis Eren University *** % ***************************************************************** % Inputs; *** % e ; two-column data set *** % x ; horizontal distances of the observation points *** % Tt ; magnetic anomaly *** % unit ; sampling interval (default:1) *** % smax ; maximum number of the graticule spacings (default:5) *** % ***************************************************************** % Outputs; *** % results.out : A text file showing the computed depths *** % ***************************************************************** close all; clear all; clc; [filename,pathname] = uigetfile({'*.dat','Select the data file'}); e=[pathname filename]; data=load(e); x=data(:,1); Tt=data(:,2); prompt = {'Enter the sampling interval in meter:',... 'Enter the maximum number of the graticule spacing:'}; dlg_title = 'Input values'; num_lines=1; def={'1','5'}; answer = inputdlg(prompt,dlg_title,num_lines,def); unit=str2double(answer(1)); smax=str2double(answer(2)); subplot(221),plot(data(:,1),data(:,2),'-o',... 'MarkerEdgeColor','r',... 'MarkerFaceColor','r',... 'MarkerSize',3); xlim([min(x) max(x)]); ylim('manual'); hold on xlabel('x in units'); ylabel(texlabel('nT')); str2 = datestr(now,'HH:MM:SS'); s=[2:smax]; err=1e-5; % Second-Order Horizontal Derivatives Computation Using Graticule Spacings for j=1:1:length(s) T2=[]; if j==1; col=[0 0 0];elseif j==2; col=[0 0 1]; elseif j==3; col=[1 0 0];elseif j==4; col=[0 0.5 0]; elseif j==5; col=[0.75 0 0.75];end for i=1+2*s(j):1:length(Tt)-2*s(j) T2a=Tt(i+(2*s(j))); T2b=2*Tt(i); T2c=Tt(i-(2*s(j))); T2(:,i)=(T2a-T2b+T2c)./(4*(s(j)^2)); end ax=-((length(T2(find(T2~=0)))-1)/2):((length(T2(find(T2~=0)))-1)/2); subplot(222) plot(ax,(T2(find(T2~=0))),'Color',[col]); xlim([min(x) max(x)]); hold on xlabel('x in units'); ylabel(texlabel('nT / unit ^2')); z=0.1; iter_min=0; iter_max=50; % Computing Depths via Nonlinear Equations while iter_min