gdaReadByIndex

Purpose

Gets a variable from a GAUSS Data Archive given a variable index.

Format

y = gdaReadByIndex(filename, varind)
Parameters:
  • filename (string) – name of data file.

  • varind (scalar) – index of variable in the GDA.

Returns:

y (matrix) – array, string or string array, variable data.

Examples

y = gdaReadByIndex("myfile.gda", 3);

Remarks

If gdaReadByIndex() fails, it will return a scalar error code. Call scalerr() to get the value of the error code. The error code may be any of the following:

1

Null file name.

2

File open error.

4

File read error.

5

Invalid file type.

8

Variable not found.

10

File contains no variables.

See also

Functions gdaRead(), gdaGetIndex()