clear

fileName = 'WF-CANONCruiseSept2010_tensionModifiedTime.txt';
fid = fopen(fileName);
fprintf(1,'Reading from file %s\n', fileName);
data = textscan(fid,'%s %d %s %s %s %f %f %s %s %f %f %f %s', 'Delimiter', '\t', 'HeaderLines', 1);
fclose(fid);

date = data{4}(:);
time = data{5}(:);
fprintf(1,'Generating spaces\n');
spaces = blanks(length(date));
fprintf(1,'Converting date and time to string array\n');
dt = [char(date) spaces' char(time)];
fprintf(1,'Converting to cell array\n');
dtCell = cellstr(dt);
fprintf(1,'Converting to datenums\n');
dtNum = datenum(dtCell);

dtProblems = find( (dtNum(2:190544)-dtNum(1:190543) ) < 0)

tensionProblems = find(tension < -1000);
tensionMod = tension;
tensionMod(tensionProblems) = [];
start = find(tensionMod > 500);
tensionMod = tensionMod(start:end);
plot(tensionMod)

