You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

18 lines
854 B
Matlab

7 years ago
function writetofilewav(wavfile, outpath, pfstring)
fid = fopen(fullfile(outpath,[pfstring '.WAV']),'w');
7 years ago
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