{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

readbuoydata - ylabel'Period subplot(2,1,2...

Info icon This 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 subplot(2,1,1); plot(data.date,data.Hs); datetick('x',6) xlabel('Time')
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern