1 function write_array_2d(filename,a)
2 % write_array_2d(filename,a)
3 % Purpose: write 2d matrix as input to WRF-Fire
6 % filename string, the name of the file
7 % a 2d matrix, the array to be written
9 % Example: write_array_2d('input_ht',ht)
12 % read_array_2d read the file back by a=read_array_2d(filename)
13 % image_array_2d visualize the array by image_array_2d(a)
15 h=fopen(filename,'w');
16 fprintf(h,'%i\n',m,n);
17 fprintf(h,'%.7g\n',a');