%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Load Delft3D gridfile in Matlab and export to PI XML format for FEWS % input % - Required availability of Delft3D-Quickplot % - The number of rows and columns need to match with the grid size %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% d3d_qp('openfile','lp02.grd') d3d_qp('selectfield','morphologic grid') d3d_qp('loaddata') fid = fopen('grids.xml','w'); fprintf(fid,'%s\n',''); fprintf(fid,'%s\n',''); fprintf(fid,'%s\n',''); fprintf(fid,'%s\n',' '); fprintf(fid,'%s\n',' Delft3D-FLOW model'); fprintf(fid,'%s\n',' 67'); fprintf(fid,'%s\n',' 63'); fprintf(fid,'%s\n',' SVY21'); for yy=1:numel(data.X(1,:)), for xx=1:numel(data.X(:,1)), fprintf(fid,'%s\n',' '); fprintf(fid,'%s\n',[' ',num2str(data.X(xx,yy)),'']); fprintf(fid,'%s\n',[' ',num2str(data.Y(xx,yy)),'']); fprintf(fid,'%s\n',' '); end end fprintf(fid,'%s\n',' '); fprintf(fid,'%s\n',''); fclose all