READ MATRIX
Name:
Type:
Purpose:
Reads data into a matrix:
- from a mass storage file;
- from within a CALLed DATAPLOT sub-program;
- from the terminal.
Description:
The rules regarding READ MATRIX are as follows:
- Only one matrix is read for a given READ MATRIX command
(additional matrices on the READ FUNCTION line are ignored).
- In scanning for the matrix, the full line image is scanned.
By default, a maximum of 1024 characters are read from
a file. To increase this, use the command
MAXIMUM RECORD LENGTH. When
reading from the terminal, a maximum of 255 characters
are read.
- Data values on a line image must be separated by at least
one blank.
- Data values can be free-format. They need not be aligned in
specific columns.
- The format of individual data values is general. It can be
integer, floating point, or exponential. It is stored
internally as a single precision real number.
- All reads start from the beginning of the file (for
variations of this, see the SKIP and ROW LIMITS commands).
- The analyst need not be concerned about the number of
observations or the number of variables for the matrix.
DATAPLOT automatically determines and reports these values at
the end of the read.
- The read terminates when a line image is encountered which
consists of
or
or when the end of the file is reached.
- The individual columns of the matrix are available as
variables (e.g., for matrix M, the columns are M1, M2, and
so on).
Syntax 1:
Syntax 2:
Examples:
Note:
By default, DATAPLOT does free format reads. However, it has the
capability for supporting FORTRAN style formats. Formatted reads
can be about 10 times faster on many systems. This can be helpful
for large data files. Enter HELP READ FORMAT for more details.
Note:
The command
DIMENSION MATRIX COLUMNS <value>
defines the maximum number of columns in a matrix whenn executing
matrix-based commands.
If you are using free format reads, this value needs to be set
as least as large as the number of columns you want to read.
If you have entered a SET READ FORMAT command, then this value
must be set to exactly the number of columns you want to read.
If the value is not exact, then the REASD MATRIX command will
not give the expected results.
The default value is 100 columns.
Note:
Note:
Blank lines in data files are ignored.
Note:
DATAPLOT supports the ability to embed comment lines within
the data file. Enter HELP COMMENT CHECK for details.
Note:
In order to determine whether the first argument is a file name or
a variable name, it looks for a period in the name. If it finds
one, it assumes a file name. If it does not, it assumes a variable
name. If your file name does not contain a period, attach a
trailing period (no spaces) to the file name on the READ command.
Note:
DATAPLOT has no restrictions on the file name other than it be a
valid file name on the local operating system and that it contain
a period "." in the file name itself or as a trailing character.
DATAPLOT strips off trailing periods on those systems where it is
appropriate to do so. On systems where trailing periods can be a
valid file name (e.g., Unix), DATAPLOT tries to open the file with
the trailing period. If this fails, it then tries to open the file
with the trailing period stripped off.
Some users prefer to give all data files a ".DAT" or ".dat"
extension. Although this is a useful method for keeping track of
data files, it is strictly a user convention and is not enforced
by DATAPLOT in any way.
Note:
File names are case sensitive on Unix file systems. For Unix,
DATAPLOT attempts to open the file as given. If this fails, it
attempts to open the file as all upper case characters. If this
fails, it attempts to open the file as all lower case characters.
All other currently supported systems are not case sensitive
regarding file names.
As a further caution for Unix hosts, certain expansion characters
(specifically ~ to refer to your home directory) are interpreted
by the shell and are not recognized by the Fortran compiler. These
expansion characters are interpreted as literal characters and do
not yield the intended file name.
Default:
- If no file name is specified and a CALL is being executed, then
the data values should be listed directly in the DATAPLOT
sub-program immediately after the READ MATRIX command (do not
forget the END OF DATA statement).
- If no file name is specified and commands are being manually
entered/executed one at a time from the terminal, then the data
should be entered directly from the terminal immediately after
the READ MATRIX command (also terminated by an END OF DATA
statement).
Synonyms:
Related Commands:
Applications:
Implementation Date:
Program:
READ MATRIX M
1 3 2
7 3 1
8 1 2
END OF DATA
Date created: 05/30/2023
Last updated: 05/30/2023
Please email comments on this WWW page to
[email protected].
|
|