function writetofileprm(prmfile, outpath, pfstring, rundescription) fid = fopen([outpath pfstring '\' pfstring '_' rundescription '.PRM'],'w'); fprintf(fid,'C> *******************************************************\n'); fprintf(fid,'C> * SBEACH initial profile input file: %s.PRM *\n',[pfstring '_' rundescription]); fprintf(fid,'C> *******************************************************\n'); fprintf(fid,'C>\n'); fprintf(fid,'C>\n'); fprintf(fid,'C> NUMBER OF POINTS\n'); fprintf(fid,'C> POSITION (m or ft), ELEVATION (m or ft)\n'); fprintf(fid,'E>----------------------------------------------------------------\n'); fprintf(fid,'%d\n',length(prmfile)); for ii = 1:length(prmfile) if ii == length(prmfile) fprintf(fid,'%4.3f %3.3f', prmfile(ii,1),prmfile(ii,2)); else fprintf(fid,'%4.3f %3.3f\n', prmfile(ii,1),prmfile(ii,2)); end end fclose(fid); end