function table = table_read ( input_filename ) %% TABLE_READ reads the information in a table file. % % % Modified: % % 21 April 2004 % % Author: % % John Burkardt % % Parameters: % % Input, character ( len = * ) INPUT_FILENAME, the name of the input file. % % Output, integer M, the number of spatial dimensions. % % Output, integer N, the number of points. The program % will stop reading data once N values have been read. % % Output, real TABLE(M,N), the point coordinates. % [ m, n ] = table_header_read ( input_filename ); if ( m <= 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'TABLE_READ - Fatal error!\n' ); fprintf ( 1, ' The spatial dimension is not positive.\n' ); end if ( n <= 0 ) fprintf ( 1, '\n' ); fprintf ( 1, 'TABLE_READ - Fatal error!\n' ); fprintf ( 1, ' The number of points is not positive.\n' ); end table(1:m,1:n) = table_data_read ( input_filename );