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.

20 lines
937 B
Matlab

7 years ago
function writetofilehdb(hdbfile, outpath, namestr)
fid = fopen([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