xmin=364; xmax=374; ymin=265; ymax=275; topo_file_name = 'VIDAL.dem'; [latgrat, longgrat, big_topo_mat, dem_info] = usgs24kdem(topo_file_name, 1); topo_mat=big_topo_mat(xmin:xmax,ymin:ymax); [topo_mat_rows, topo_mat_cols] = size(topo_mat) x_vec = 30 * linspace(0, xmax-xmin, xmax-xmin+1); y_vec = -30 * linspace(0, ymax-ymin, ymax-ymin+1); [x_mat, y_mat] = meshgrid(x_vec, y_vec); Corner = zeros(8*length(y_vec)*length(x_vec),3); Face = zeros(6*length(y_vec)*length(x_vec),5); for y=1:length(y_vec) for x=1:length(x_vec) blocknum=length(x_vec)*(y-1)+x-1; %Corner(8*blocknum+1,:) = [x_vec(x)-15,y_vec(y)-15,-topo_mat(y,x)]; %Corner(8*blocknum+2,:) = [x_vec(x)+15,y_vec(y)-15,-topo_mat(y,x)]; %Corner(8*blocknum+3,:) = [x_vec(x)+15,y_vec(y)+15,-topo_mat(y,x)]; %Corner(8*blocknum+4,:) = [x_vec(x)-15,y_vec(y)+15,-topo_mat(y,x)]; Corner(8*blocknum+1,:) = [y_vec(y)-15,x_vec(x)-15,-topo_mat(y,x)]; Corner(8*blocknum+2,:) = [y_vec(y)-15,x_vec(x)+15,-topo_mat(y,x)]; Corner(8*blocknum+3,:) = [y_vec(y)+15,x_vec(x)+15,-topo_mat(y,x)]; Corner(8*blocknum+4,:) = [y_vec(y)+15,x_vec(x)-15,-topo_mat(y,x)]; Corner(8*blocknum+5,:) = [y_vec(y)-15,x_vec(x)-15,0]; Corner(8*blocknum+6,:) = [y_vec(y)-15,x_vec(x)+15,0]; Corner(8*blocknum+7,:) = [y_vec(y)+15,x_vec(x)+15,0]; Corner(8*blocknum+8,:) = [y_vec(y)+15,x_vec(x)-15,0]; Face(6*blocknum+1,:) = [4,1,2,3,4]+8*blocknum.*[0,1,1,1,1]; Face(6*blocknum+2,:) = [4,8,7,6,5]+8*blocknum.*[0,1,1,1,1]; Face(6*blocknum+3,:) = [4,8,5,1,4]+8*blocknum.*[0,1,1,1,1]; Face(6*blocknum+4,:) = [4,6,7,3,2]+8*blocknum.*[0,1,1,1,1]; Face(6*blocknum+5,:) = [4,5,6,2,1]+8*blocknum.*[0,1,1,1,1]; Face(6*blocknum+6,:) = [4,7,8,4,3]+8*blocknum.*[0,1,1,1,1]; end end calgrv=1; calmag=0; Ncor=8*length(y_vec)*length(x_vec); Nf=6*length(y_vec)*length(x_vec); Hintn=50000; Hincl=50; Decl=0; Susc=0.01; Mstrength=0; Mincl=0; Mdecl=0; fht=350; dens=2.67; Corner(:,3)=Corner(:,3)+fht; %shift down because measurements are at zero %Comments: Rectangular grid of stations for computing fields. %Profiles are along the x-axis (north-south direction). All values %are in meters. s_end= 150;%-320; % Starting value of x; south end of profiles stn_spcng = 1;%40; % Stepsize in north direction; stn interval n_end= 150% 320; % Last x; maximum north coordinate w_end= 150; % y value for westernmost profile prof_spcng=1; % Profile spacing e_end= 150; % y value for easternmost profile