% script do_adj_tipod_dep.m % does all the necessary steps to start correcting tripod WATER_DEPTH % stuff % first get the new water depth info from the file from Brad- he sent a % .xls. I had to edit it to have one answer per tripod, and then save as % CSV. you don't want ' or " around the pressure file name [moorid, mname, pval, sd, sh, ndep]=textread('lta_newdep_v3.txt','%n%s%n%n%n%n','delimiter',','); % Then you read the edited .xls file from Chris Sabens- Make sure you've % forced the _cmab columns to be numeric- the rest should be text- % particularly column 1 [cmab_dat, vals,vst]=extract_hab('MassBay_cmab_ed.xls'); % THen put together the "new" structure for adj_tripod_dep new.moor_no=632; % this assumes the MassBay*xls is the same size as lta_newdep* % new.new_water_depth=ndep(strmatch(num2str(new.moor_no), [cmab_dat.moorid])-1) % this method works when one file is smaller than the other. new.new_water_depth=ndep(find(new.moor_no == moorid)); cmnt=['water depth computed using mean pressure from ' char(mname(find(new.moor_no == moorid))) ' - atmosphere (1013.3)'] new.cmnt=cmnt; % finally call adj_tripod_dep- % this actually modifies files, so beware! r1=adj_tripod_depth(new, cmab_dat);