function writetofileang(angfile, outpath, pfstring) fid = fopen([outpath '\' pfstring '.ANG'],'w'); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C> * SBEACH wave input file: %s.ANG *\r\n',pfstring); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C> DIRECTION (DEGREES)\r\n'); fprintf(fid,'E>----------------------------------------------------------------\r\n'); for ii = 1:length(angfile) if ii == length(angfile) fprintf(fid,'%.3f\r\n', angfile(ii)); else fprintf(fid,'%.3f\r\n', angfile(ii)); end end fclose(fid); end