1 |
|
2 |
%---- modify bathymetry file: close the Northern boundary: |
3 |
nx=20; ny=16; |
4 |
|
5 |
%- read-in original file: |
6 |
fid=fopen('bathy.labsea1979','r','b'); |
7 |
h0=fread(fid,nx*ny,'real*4'); fclose(fid); |
8 |
h0=reshape(h0,[nx ny]); |
9 |
|
10 |
%- close Norther boundary (put a wall): |
11 |
h=h0; h(:,end)=0; |
12 |
|
13 |
%- write to file: |
14 |
fid=fopen('bathy_closeN.bin','w','b'); fwrite(fid,h,'real*4'); fclose(fid); |
15 |
|
16 |
%- plot to check |
17 |
figure(1);clf; |
18 |
subplot(211) |
19 |
imagesc(h0'); set(gca,'YDir','normal'); |
20 |
colorbar |
21 |
title('Original Bathy') |
22 |
|
23 |
subplot(212) |
24 |
imagesc(h'); set(gca,'YDir','normal'); |
25 |
colorbar |
26 |
title('Modified Bathy') |