Usage: |
x = readcond(file, r, c, condcols, condition)
|
Input: |
| file | string containing the name of the file which should be read
|
| r | p1 x 2 matrix, it specifies, which rows should be read.
Every row consists of two numbers namely r1 and r2:
1) if both numbers are positive, they specify that all rows
with indices {r1,...,r2} should be read in;
2) if both numbers are negative, they specify that the rows
with indices {|r1|,...,|r2|} should be excluded from reading;
3) it is not possible to mix inclusion and exclusion
conditions.
Note that if you enter a scalar, it will be ignored and all
rows are read.
|
| c | p2 x 2 matrix, it specifies, which columns should be read.
Every column consists of two numbers namely r1 and r2:
1) if both numbers are positive, they specify that all columns
with indices {r1,...,r2} should be read in;
2) if both number are negative, they specify that the columns
with indices {|r1|,...,|r2|} should be excluded from reading;
3) it is not possible to mix inclusion and exclusion conditions.
Note that if you enter a scalar, it will be ignored and
all columns are read.
|
| condcols | p3 x 1 vector, it specifies to which columns in file
that is to be read the condition should be applied. Note that
the columns can deviate from the parameter c, i.e. you can
read data without the columns where the condition is evaluated.
|
| condition | string, specifies a valid condition. "x" is
the matrix to which the condition is applied. The
numeration of the columns in x follows the number of
columns as specified in condcols, i.e. if you read by
means of condcols 3 columns altogether and the third column
is crucial for the condition, write "x[,3]".
|
Output: |
| x | matrix of the data read according to the condition;
Note that the vector or matrix indices refer to the matrix,
which is actually read not to the original one. |