function table_io_test01 ( ) %% TABLE_IO_TEST01 tests DTABLE_WRITE. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 27 September 2006 % % Author: % % John Burkardt % n = 20; m = 5; output_filename = 'dtable_05_00020.txt'; fprintf ( 1, '\n' ); fprintf ( 1, 'TEST01\n' ); fprintf ( 1, ' DTABLE_WRITE writes a double precision TABLE file.\n' ); for i = 1 : m for j = 1 : n table(i,j) = ( 100 * j + i ); end end fprintf ( 1, '\n' ); fprintf ( 1, ' Spatial dimension M = %d\n', m ); fprintf ( 1, ' Number of points N = %d\n', n ); r8mat_print_some ( m, n, table, 1, 1, 5, 5, ... ' 5x5 portion of the data written to file:' ); r8mat_transpose_print_some ( m, n, table, 1, 1, 5, 5, ... ' 5x5 portion of the TRANSPOSED data:' ); header = 1; dtable_write ( output_filename, m, n, table, header ); fprintf ( 1, '\n' ); fprintf ( 1, ' Wrote the header and data for %s\n', output_filename ); return end