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
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"):
WARNING, when reading binary files under Windows to not forget to open the file with the b option like fd1=mopen(file1,'rb') if not the file will be interpreted as text file and the bytes with value 13 will be interpreted as newlines and ommitted.
file1 = 'test1.bin'; file2 = 'test2.bin'; fd1=mopen(file1,'wb'); fd2=mopen(file2,'wb'); mput(1996,'ull',fd1); mput(1996,'ull',fd2); mclose(fd1); mclose(fd2); fd1=mopen(file1,'rb'); if 1996<>mget(1,'ull',fd1) ;write(%io(2),'Bug');end; fd2=mopen(file2,'rb'); if 1996<>mget(1,'ull',fd2) ;write(%io(2),'Bug');end; mclose(fd1); mclose(fd2);
mclose , meof , mfprintf , fprintfMat , mfscanf , fscanfMat , mget , mgetstr , mopen , mprintf , mput , mputstr , mscanf , mseek , mtell , mdelete ,