function writetofilehdb(hdbfile, outpath, namestr) fid = fopen(fullfile(outpath,[namestr '.HDB']),'w'); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C> * SBEACH hard bottom input file: %s.HDB *\r\n',namestr); fprintf(fid,'C> *******************************************************\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C>\r\n'); fprintf(fid,'C> NUMBER OF POINTS\r\n'); fprintf(fid,'C> POSITION (m or ft), ELEVATION (m or ft)\r\n'); fprintf(fid,'E>----------------------------------------------------------------\r\n'); fprintf(fid,'%d\r\n',length(hdbfile)); for ii = 1:length(hdbfile) if ii == length(hdbfile) fprintf(fid,'%.3f %.3f\r\n', hdbfile(ii,1),hdbfile(ii,2)); else fprintf(fid,'%.3f %.3f\r\n', hdbfile(ii,1),hdbfile(ii,2)); end end fclose(fid); end