a MATLAB code which
can read or write a TABLE file.
A TABLE file is a simple format for storing a double-indexed
array of data. We regard this is a situation involving N
points in M dimensions, with M relatively small
(often just 2 or 3, but possibly 10 or 20) while N can
be "enormous" (10, 100, 1,000 or 10,000).
To keep things simple, then, the data is written to an ASCII
file, with optional comment lines (which must start with the
'#' character) and blank lines (which are ignored). The point
data is stored by writing the coordinates of each point on
a separate line. No information about M or N is
explicitly included in the file.
It is up to the I/O program to determine this.
TABLE_IO supplies routines by which a TABLE file can
easily be written or read. A typical write operation simply
calls routine R8MAT_WRITE. A typical read operation
will probably first want to call R8MAT_HEADER_READ
to determine the values of M and N, and then
allocate space for the table, and then call R8MAT_DATA_READ
to read the data.
The computer code and data files described and made available on this web page
are distributed under
the GNU LGPL license.
table_io is available in
a C version and
a C++ version and
a FORTRAN90 version and
a MATLAB version and
a Python version and
Related Data and Programs:
a format which
is used for the files input or output by the TABLE_IO library.
returns the uppercase version of a character.
counts the number of columns in the first line of a file.
counts the number of row records in a file.
returns the integer part of the logarithm, base 10, of an integer.
adds a "border" to an I4MAT.
cuts the "border" of an I4MAT.
reads a table from an I4MAT file.
reads a header from an I4MAT file.
sets up an indicator I4MAT.
prints an I4MAT.
prints some of an I4MAT.
reads an I4MAT file.
writes the transpose of an I4MAT to a file.
writes an I4MAT to a file.
reads the data from an I4VEC file.
writes an I4VEC to a file.
reads a table from an L4VEC file.
reads a header from an L4VEC file.
writes an L4VEC (logical vector) to a file.
adds a "border" to an R8MAT.
cuts the "border" of an R8MAT.
reads the data from an R8MAT file.
reads the header from an R8MAT file.
sets up an indicator R8MAT.
prints an R8MAT.
prints some of an R8MAT.
reads an R8MAT from a text file.
reads an R8MAT from a binary file.
prints the transpose of an R8MAT.
prints the transpose of some of an R8MAT.
fills an R8MAT with pseudorandom numbers.
writes an R8MAT to a text file.
writes an R8MAT to a binary file.
reads the data from an R8VEC file.
reads the header from an R8VEC file.
prints an R8VEC.
returns a random R8VEC in [0,1].
writes an R8VEC to a file.
writes an R8VEC2 to a file.
returns the length of a character string to the last nonblank.
extracts a logical value from a string.
counts the number of words in a string.
Last revised on 18 February 2019.