function htd = readhtd(filename)
    fid = fopen(filename);
    dataset=textscan(fid,'%f %f %f %f %f %f');
    htd = createhtd();
    htd.dayno=dataset{1};
    htd.waveheight=dataset{2};
    htd.peakwaveperiod=dataset{3};
    htd.wavedirection=dataset{4};
    htd.TM02waveperiod=dataset{5};
    htd.meanperiod=dataset{6};
    fclose(fid)
    return
end
