readbuoydata3

readbuoydata3 - subplot(2,1,1); plot(data.date,data.Hs);...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
function [data, count] = readbuoydata(datafile) fid = fopen(datafile,'r'); %Open datafile tline = fgetl(fid); %Read next line of file tline = fgetl(fid); %Read next line of file [A,count] = fscanf(fid,'%d %d %d %d %d %f %f %d %f %f',[10 inf]); %Read file and convert into array A. Count is te number of successful reads data.date = datenum([A(1:5,:); zeros(1,size(A,2))]')'; %Convert date/time in specified vectors data.Hs = A(6,:); % significant wave height data.Tp = A(7,:); % peak period data.Dp = A(8,:); % peak period direction data.Ta = A(9,:); % average period data.SST = A(10,:); % sea surface temperature
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: subplot(2,1,1); plot(data.date,data.Hs); datetick('x',6) subplot(2,1,2); plot(data.date,data.Tp); datetick('x',6) avgdata=mafilt(5,data.Tp); subplot(3,1,1) plot(data.Tp,'color',[0.8 0.8 0.8],'LineWidth',2); hold on; plot(avgdata,'k'); hold off; avgdata=mafiltc(51,data.Tp); subplot(3,1,2) plot(data.Tp,'color',[0.8 0.8 0.8],'LineWidth',2); hold on; plot(avgdata,'k'); hold off; avgdata=mafilt(51,data.Tp); subplot(3,1,3) plot(data.Tp,'color',[0.8 0.8 0.8],'LineWidth',2); hold on; plot(avgdata,'k'); hold off; fclose(fid);...
View Full Document

Ask a homework question - tutors are online