function writetofilewav(wavfile, outpath, pfstring) fid = fopen([outpath '\' pfstring '.WAV'],'w'); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C> * SBEACH wave input file: %s.WAV *\r\n',pfstring); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C> HEIGHT (m or ft), PERIOD (sec)\r\n'); fprintf(fid,'E>----------------------------------------------------------------\r\n'); for ii = 1:length(wavfile) if ii == length(wavfile) fprintf(fid,'%.3f %.3f\r\n', wavfile(ii,1),wavfile(ii,2)); else fprintf(fid,'%.3f %.3f\r\n', wavfile(ii,1),wavfile(ii,2)); end end fclose(fid); end