Scilab Function

mget - reads byte or word in a given binary format and convert to double

mgeti - reads byte or word in a given binary format return an int type

Calling Sequence

x=mget([n,type,fd])
x=mgeti([n,type,fd])

Parameters

Description

The mget function reads data in the input specified by the stream parameter fd and returns a vector of floating point data. The mgeti function reads data in the input specified by the stream parameter fd and returns a vector of integer data.

Data is read at the position at which the file pointer is currently pointing and advances the indicator appropriately.

The type parameter is a conversion specifier which may be set to any of the following flag characters (with default value "l"):

  • "l","i","s","ul","ui","us","d","f","c","uc" : for reading respectively a long, an int, a short, an unsigned long, an unsigned int, an unsigned short, a double, a float, a char and an unsigned char. The bytes which are read are automatically swapped if necessary (by checking little-endian status). This default swapping mode can be suppressed by adding a flag in the mopen function. Format "l", "d" and "f" are valid only with the mget function.
  • "..l" or "..b" : It is also possible to read in little-endian or big-endian mode by adding a 'l' or 'b' character at the end of a type specification. For example "db" will read a double in big-endian mode.
  • Examples

    See Also