Internal Functions


Defines

#define swap(a, b)   a^=b;b^=a;a^=b
 swap the bytes a and b

Functions

int InflateArrayFlags (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the Array Flags Tag and the Array Flags data.
int InflateData (mat_t *mat, z_stream *z, void *buf, int nBytes)
 Inflates the data.
int InflateDataTag (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the data's tag.
int InflateDataType (mat_t *mat, z_stream *z, void *buf)
 Inflates the data's type.
int InflateDimensions (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the dimensions tag and the dimensions data.
int InflateFieldNameLength (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the structure's fieldname length.
int InflateFieldNames (mat_t *mat, matvar_t *matvar, void *buf, int nfields, int fieldname_length, int padding)
 Inflates the structure's fieldnames.
int InflateFieldNamesTag (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the structure's fieldname tag.
int InflateSkip (mat_t *mat, z_stream *z, int nbytes)
 Inflate the data until nbytes of uncompressed data has been inflated.
int InflateSkip2 (mat_t *mat, matvar_t *matvar, int nbytes)
 Inflate the data until nbytes of compressed data has been inflated.
int InflateSkipData (mat_t *mat, z_stream *z, int data_type, int len)
 Inflate the data until len elements of compressed data with data type data_type has been inflated.
int InflateVarName (mat_t *mat, matvar_t *matvar, void *buf, int N)
 Inflates the variable name.
int InflateVarNameTag (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the variable name tag.
int InflateVarTag (mat_t *mat, matvar_t *matvar, void *buf)
 Inflates the variable's tag.
double Mat_doubleSwap (double *a)
 swap the bytes of a 4 or 8 byte double-precision float
float Mat_floatSwap (float *a)
 swap the bytes of a 4 byte single-precision float
mat_int16_t Mat_int16Swap (mat_int16_t *a)
 swap the bytes of a 16-bit signed integer
mat_int32_t Mat_int32Swap (mat_int32_t *a)
 swap the bytes of a 32-bit signed integer
mat_int64_t Mat_int64Swap (mat_int64_t *a)
 swap the bytes of a 64-bit signed integer
mat_uint16_t Mat_uint16Swap (mat_uint16_t *a)
 swap the bytes of a 16-bit unsigned integer
mat_uint32_t Mat_uint32Swap (mat_uint32_t *a)
 swap the bytes of a 32-bit unsigned integer
mat_uint64_t Mat_uint64Swap (mat_uint64_t *a)
 swap the bytes of a 64-bit unsigned integer
void Mat_VarPrint5 (matvar_t *matvar, int printdata)
 Prints the mat variable.
matvar_tMat_VarReadNextInfo5 (mat_t *mat)
 Reads the header information for the next MAT variable.
void Read5 (mat_t *mat, matvar_t *matvar)
 Reads the data of a version 5 MAT variable.
int ReadCompressedCharData (mat_t *mat, z_stream *z, char *data, int data_type, int len)
 Reads data of type data_type into a char type.
int ReadCompressedDataSlab2 (mat_t *mat, z_stream *z, void *data, int class_type, int data_type, int *dims, int *start, int *stride, int *edge)
 Reads data of type data_type by user-defined dimensions for 2-D data.
int ReadCompressedDataSlabN (mat_t *mat, z_stream *z, void *data, int class_type, int data_type, int rank, int *dims, int *start, int *stride, int *edge)
 Reads data of type data_type by user-defined dimensions.
int ReadCompressedDoubleData (mat_t *mat, z_stream *z, double *data, int data_type, int len)
 Reads data of type data_type into a double type.
int ReadCompressedInt16Data (mat_t *mat, z_stream *z, mat_int16_t *data, int data_type, int len)
 Reads data of type data_type into a signed 16-bit integer type.
int ReadCompressedInt32Data (mat_t *mat, z_stream *z, mat_int32_t *data, int data_type, int len)
 Reads data of type data_type into a signed 32-bit integer type.
int ReadCompressedInt64Data (mat_t *mat, z_stream *z, mat_int64_t *data, int data_type, int len)
 Reads data of type data_type into a signed 64-bit integer type.
int ReadCompressedInt8Data (mat_t *mat, z_stream *z, mat_int8_t *data, int data_type, int len)
 Reads data of type data_type into a signed 8-bit integer type.
int ReadCompressedSingleData (mat_t *mat, z_stream *z, float *data, int data_type, int len)
 Reads data of type data_type into a float type.
int ReadCompressedUInt16Data (mat_t *mat, z_stream *z, mat_uint16_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 16-bit integer type.
int ReadCompressedUInt32Data (mat_t *mat, z_stream *z, mat_uint32_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 32-bit integer type.
int ReadCompressedUInt64Data (mat_t *mat, z_stream *z, mat_uint64_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 64-bit integer type.
int ReadCompressedUInt8Data (mat_t *mat, z_stream *z, mat_uint8_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 8-bit integer type.
int ReadData5 (mat_t *mat, matvar_t *matvar, void *data, int *start, int *stride, int *edge)
 Reads a slab of data from the mat variable matvar.
int ReadDataSlab2 (mat_t *mat, void *data, int class_type, int data_type, int *dims, int *start, int *stride, int *edge)
 Reads data of type data_type by user-defined dimensions for 2-D data.
int ReadDataSlabN (mat_t *mat, void *data, int class_type, int data_type, int rank, int *dims, int *start, int *stride, int *edge)
 Reads data of type data_type by user-defined dimensions.
int ReadDoubleData (mat_t *mat, double *data, int data_type, int len)
 Reads data of type data_type into a double type.
int ReadInt16Data (mat_t *mat, mat_int16_t *data, int data_type, int len)
 Reads data of type data_type into a signed 16-bit integer type.
int ReadInt32Data (mat_t *mat, mat_int32_t *data, int data_type, int len)
 Reads data of type data_type into a signed 32-bit integer type.
int ReadInt64Data (mat_t *mat, mat_int64_t *data, int data_type, int len)
 Reads data of type data_type into a signed 64-bit integer type.
int ReadInt8Data (mat_t *mat, mat_int8_t *data, int data_type, int len)
 Reads data of type data_type into a signed 8-bit integer type.
int ReadNextCell (mat_t *mat, matvar_t *matvar)
 Reads the next cell of the cell array in matvar.
int ReadNextFunctionHandle (mat_t *mat, matvar_t *matvar)
 Reads the function handle data of the function handle in matvar.
int ReadNextStructField (mat_t *mat, matvar_t *matvar)
 Reads the next struct field of the structure in matvar.
int ReadSingleData (mat_t *mat, float *data, int data_type, int len)
 Reads data of type data_type into a float type.
int ReadUInt16Data (mat_t *mat, mat_uint16_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 16-bit integer type.
int ReadUInt32Data (mat_t *mat, mat_uint32_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 32-bit integer type.
int ReadUInt64Data (mat_t *mat, mat_uint64_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 64-bit integer type.
int ReadUInt8Data (mat_t *mat, mat_uint8_t *data, int data_type, int len)
 Reads data of type data_type into an unsigned 8-bit integer type.
int Write5 (mat_t *mat, matvar_t *matvar, int compress)
 Writes a matlab variable to a version 5 matlab file.
int WriteCellArrayField (mat_t *mat, matvar_t *matvar)
 Writes the header and data for an element of a cell array.
int WriteCellArrayFieldInfo (mat_t *mat, matvar_t *matvar)
 Writes the header and blank data for a cell array.
int WriteCharData (mat_t *mat, void *data, int N, int data_type)
 Writes data as character data.
int WriteCharDataSlab2 (mat_t *mat, void *data, int data_type, int *dims, int *start, int *stride, int *edge)
size_t WriteCompressedCellArrayField (mat_t *mat, matvar_t *matvar, z_stream *z)
 Writes the header and data for a field of a compressed cell array.
size_t WriteCompressedCharData (mat_t *mat, z_stream *z, void *data, int N, int data_type)
 Writes data as compressed character data.
size_t WriteCompressedStructField (mat_t *mat, matvar_t *matvar, z_stream *z)
 Writes the header and data for a field of a compressed struct array.
int WriteDataSlab2 (mat_t *mat, void *data, int data_type, int *dims, int *start, int *stride, int *edge)
int WriteEmptyCharData (mat_t *mat, int N, int data_type)
 Writes empty characters to the MAT file.
void WriteInfo5 (mat_t *mat, matvar_t *matvar)
 Writes the variable information and empty data.
int WriteStructField (mat_t *mat, matvar_t *matvar)
 Writes the header and data for a field of a struct array.

Function Documentation

int InflateArrayFlags ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least 16 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the 16-byte array flags tag and data
Returns:
Number of bytes read from the file

int InflateData ( mat_t mat,
z_stream *  z,
void *  buf,
int  nBytes 
)

buf must hold at least nBytes bytes

Parameters:
mat Pointer to the MAT file
z zlib compression stream
buf Pointer to store the data type
nBytes Number of bytes to inflate
Returns:
Number of bytes read from the file

int InflateDataTag ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least 8 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the data tag
Returns:
Number of bytes read from the file

int InflateDataType ( mat_t mat,
z_stream *  z,
void *  buf 
)

buf must hold at least 4 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the data type
Returns:
Number of bytes read from the file

int InflateDimensions ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least (8+4*rank) bytes where rank is the number of dimensions. If the end of the dimensions data is not aligned on an 8-byte boundary, this function eats up those bytes and stores then in buf.

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the dimensions flag and data
Returns:
Number of bytes read from the file

int InflateFieldNameLength ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least 8 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the fieldname length
Returns:
Number of bytes read from the file

int InflateFieldNames ( mat_t mat,
matvar_t matvar,
void *  buf,
int  nfields,
int  fieldname_length,
int  padding 
)

buf must hold at least nfields * fieldname_length bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the fieldnames
nfields Number of fields
fieldname_length Maximum length in bytes of each field
padding Number of padding bytes
Returns:
Number of bytes read from the file

int InflateFieldNamesTag ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least 8 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the fieldname tag
Returns:
Number of bytes read from the file

int InflateSkip ( mat_t mat,
z_stream *  z,
int  nbytes 
)

Parameters:
mat Pointer to the MAT file
z zlib compression stream
nbytes Number of uncompressed bytes to skip
Returns:
Number of bytes read from the file

int InflateSkip2 ( mat_t mat,
matvar_t matvar,
int  nbytes 
)

Parameters:
mat Pointer to the MAT file
z zlib compression stream
nbytes Number of uncompressed bytes to skip
Returns:
Number of bytes read from the file

int InflateSkipData ( mat_t mat,
z_stream *  z,
int  data_type,
int  len 
)

Parameters:
mat Pointer to the MAT file
z zlib compression stream
data_type Data type (matio_types enumerations)
len Number of elements of datatype data_type to skip
Returns:
Number of bytes read from the file

int InflateVarName ( mat_t mat,
matvar_t matvar,
void *  buf,
int  N 
)

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the variables name
N Number of characters in the name
Returns:
Number of bytes read from the file

int InflateVarNameTag ( mat_t mat,
matvar_t matvar,
void *  buf 
)

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the variables name tag
Returns:
Number of bytes read from the file

int InflateVarTag ( mat_t mat,
matvar_t matvar,
void *  buf 
)

buf must hold at least 8 bytes

Parameters:
mat Pointer to the MAT file
matvar Pointer to the MAT variable
buf Pointer to store the 8-byte variable tag
Returns:
Number of bytes read from the file

double Mat_doubleSwap ( double *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

float Mat_floatSwap ( float *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_int16_t Mat_int16Swap ( mat_int16_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_int32_t Mat_int32Swap ( mat_int32_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_int64_t Mat_int64Swap ( mat_int64_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_uint16_t Mat_uint16Swap ( mat_uint16_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_uint32_t Mat_uint32Swap ( mat_uint32_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

mat_uint64_t Mat_uint64Swap ( mat_uint64_t *  a  ) 

Parameters:
a pointer to integer to swap
Returns:
the swapped integer

void Mat_VarPrint5 ( matvar_t matvar,
int  printdata 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable

matvar_t* Mat_VarReadNextInfo5 ( mat_t mat  ) 

Parameters:
mat MAT file pointer pointer to the MAT variable or NULL

void Read5 ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar MAT variable pointer to read the data

int ReadCompressedCharData ( mat_t mat,
z_stream *  z,
char *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as char's in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output char values (len*sizeof(char))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedDataSlab2 ( mat_t mat,
z_stream *  z,
void *  data,
int  class_type,
int  data_type,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
mat MAT file pointer
z zlib compression stream
data Pointer to store the output data
class_type Type of data class (matio_classes enumerations)
data_type Datatype of the stored data (matio_types enumerations)
dims Dimensions of the data
start Index to start reading data in each dimension
stride Read every stride elements in each dimension
edge Number of elements to read in each dimension
Return values:
Number of bytes read from the file, or -1 on error

int ReadCompressedDataSlabN ( mat_t mat,
z_stream *  z,
void *  data,
int  class_type,
int  data_type,
int  rank,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
mat MAT file pointer
z zlib compression stream
data Pointer to store the output data
class_type Type of data class (matio_classes enumerations)
data_type Datatype of the stored data (matio_types enumerations)
rank Number of dimensions in the data
dims Dimensions of the data
start Index to start reading data in each dimension
stride Read every stride elements in each dimension
edge Number of elements to read in each dimension
Return values:
Number of bytes read from the file, or -1 on error

int ReadCompressedDoubleData ( mat_t mat,
z_stream *  z,
double *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as double's in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output double values (len*sizeof(double))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedInt16Data ( mat_t mat,
z_stream *  z,
mat_int16_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as signed 16-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output signed 16-bit integer values (len*sizeof(mat_int16_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedInt32Data ( mat_t mat,
z_stream *  z,
mat_int32_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as signed 32-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output signed 32-bit integer values (len*sizeof(mat_int32_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedInt64Data ( mat_t mat,
z_stream *  z,
mat_int64_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as signed 64-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output signed 64-bit integer values (len*sizeof(mat_int64_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedInt8Data ( mat_t mat,
z_stream *  z,
mat_int8_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as signed 8-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output signed 8-bit integer values (len*sizeof(mat_int8_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedSingleData ( mat_t mat,
z_stream *  z,
float *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as float's in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output float values (len*sizeof(float))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedUInt16Data ( mat_t mat,
z_stream *  z,
mat_uint16_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as unsigned 16-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output n unsigned 16-bit integer values (len*sizeof(mat_uint16_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedUInt32Data ( mat_t mat,
z_stream *  z,
mat_uint32_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as unsigned 32-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output unsigned 32-bit integer values (len*sizeof(mat_uint32_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedUInt64Data ( mat_t mat,
z_stream *  z,
mat_uint64_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as unsigned 64-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output unsigned 64-bit integer values (len*sizeof(mat_uint64_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadCompressedUInt8Data ( mat_t mat,
z_stream *  z,
mat_uint8_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len compressed elements of data type data_type storing them as unsigned 8-bit integers in data.

Parameters:
mat MAT file pointer
z Pointer to the zlib stream for inflation
data Pointer to store the output 8-bit integer values (len*sizeof(mat_uint8_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadData5 ( mat_t mat,
matvar_t matvar,
void *  data,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
data pointer to store the read data in (must be of size edge[0]*...edge[rank-1]*Mat_SizeOfClass(matvar->class_type))
start index to start reading data in each dimension
stride write data every stride elements in each dimension
edge number of elements to read in each dimension
Return values:
0 on success

int ReadDataSlab2 ( mat_t mat,
void *  data,
int  class_type,
int  data_type,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
mat MAT file pointer
data Pointer to store the output data
class_type Type of data class (matio_classes enumerations)
data_type Datatype of the stored data (matio_types enumerations)
dims Dimensions of the data
start Index to start reading data in each dimension
stride Read every stride elements in each dimension
edge Number of elements to read in each dimension
Return values:
Number of bytes read from the file, or -1 on error

int ReadDataSlabN ( mat_t mat,
void *  data,
int  class_type,
int  data_type,
int  rank,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
mat MAT file pointer
data Pointer to store the output data
class_type Type of data class (matio_classes enumerations)
data_type Datatype of the stored data (matio_types enumerations)
rank Number of dimensions in the data
dims Dimensions of the data
start Index to start reading data in each dimension
stride Read every stride elements in each dimension
edge Number of elements to read in each dimension
Return values:
Number of bytes read from the file, or -1 on error

int ReadDoubleData ( mat_t mat,
double *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as double's in data.

Parameters:
mat MAT file pointer
data Pointer to store the output double values (len*sizeof(double))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadInt16Data ( mat_t mat,
mat_int16_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as signed 16-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output signed 16-bit integer values (len*sizeof(mat_int16_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadInt32Data ( mat_t mat,
mat_int32_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as signed 32-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output signed 32-bit integer values (len*sizeof(mat_int32_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadInt64Data ( mat_t mat,
mat_int64_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as signed 64-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output signed 64-bit integer values (len*sizeof(mat_int64_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadInt8Data ( mat_t mat,
mat_int8_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as signed 8-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output signed 8-bit integer values (len*sizeof(mat_int8_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadNextCell ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar MAT variable pointer
Returns:
Number of bytes read

int ReadNextFunctionHandle ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar MAT variable pointer
Returns:
Number of bytes read

int ReadNextStructField ( mat_t mat,
matvar_t matvar 
)

Reads the next struct fields (fieldname length,names,data headers for all the fields

Parameters:
mat MAT file pointer
matvar MAT variable pointer
Returns:
Number of bytes read

int ReadSingleData ( mat_t mat,
float *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as float's in data.

Parameters:
mat MAT file pointer
data Pointer to store the output float values (len*sizeof(float))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadUInt16Data ( mat_t mat,
mat_uint16_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as unsigned 16-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output unsigned 16-bit integer values (len*sizeof(mat_uint16_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadUInt32Data ( mat_t mat,
mat_uint32_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as unsigned 32-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output unsigned 32-bit integer values (len*sizeof(mat_uint32_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadUInt64Data ( mat_t mat,
mat_uint64_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as unsigned 64-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output unsigned 64-bit integer values (len*sizeof(mat_uint64_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int ReadUInt8Data ( mat_t mat,
mat_uint8_t *  data,
int  data_type,
int  len 
)

Reads from the MAT file len elements of data type data_type storing them as unsigned 8-bit integers in data.

Parameters:
mat MAT file pointer
data Pointer to store the output unsigned 8-bit integer values (len*sizeof(mat_uint8_t))
data_type one of the matio_types enumerations which is the source data type in the file
len Number of elements of type data_type to read from the file
Return values:
Number of bytes read from the file

int Write5 ( mat_t mat,
matvar_t matvar,
int  compress 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
compress option to compress the variable (only works for numeric types)
Return values:
0 on success

int WriteCellArrayField ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
Return values:
0 on success

int WriteCellArrayFieldInfo ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
Returns:
number of bytes written

int WriteCharData ( mat_t mat,
void *  data,
int  N,
int  data_type 
)

This function uses the knowledge that the data is part of a character class to avoid some pitfalls with Matlab listed below.

Parameters:
mat MAT file pointer
data character data to write
N Number of elements to write
data_type character data type (enum matio_types)
Returns:
number of bytes written

int WriteCharDataSlab2 ( mat_t mat,
void *  data,
int  data_type,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
Writes a 2-D slab of character data to the MAT file
This function uses the knowledge that the data is part of a character class to avoid some pitfalls with Matlab listed below. should return the number of bytes written, but currently returns 0
Parameters:
mat MAT file pointer
data pointer to the slab of data
data_type data type of the data (enum matio_types)
dims dimensions of the dataset
start index to start writing the data in each dimension
stride write data every stride elements
edge number of elements to write in each dimension
Returns:
number of byteswritten

size_t WriteCompressedCellArrayField ( mat_t mat,
matvar_t matvar,
z_stream *  z 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
Returns:
number of bytes written to the MAT file

size_t WriteCompressedCharData ( mat_t mat,
z_stream *  z,
void *  data,
int  N,
int  data_type 
)

This function uses the knowledge that the data is part of a character class to avoid some pitfalls with Matlab listed below.

Parameters:
mat MAT file pointer
z pointer to the zlib compression stream
data character data to write
N Number of elements to write
data_type character data type (enum matio_types)
Returns:
number of bytes written

size_t WriteCompressedStructField ( mat_t mat,
matvar_t matvar,
z_stream *  z 
)

Currently does not work for cell arrays or sparse data

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
Returns:
number of bytes written to the MAT file

int WriteDataSlab2 ( mat_t mat,
void *  data,
int  data_type,
int *  dims,
int *  start,
int *  stride,
int *  edge 
)

Parameters:
Writes a 2-D slab of data to the MAT file
should return the number of bytes written, but currently returns 0
Parameters:
mat MAT file pointer
data pointer to the slab of data
data_type data type of the data (enum matio_types)
dims dimensions of the dataset
start index to start writing the data in each dimension
stride write data every stride elements
edge number of elements to write in each dimension
Returns:
number of byteswritten

int WriteEmptyCharData ( mat_t mat,
int  N,
int  data_type 
)

This function uses the knowledge that the data is part of a character class to avoid some pitfalls with Matlab listed below.

Parameters:
mat MAT file pointer
data character data to write
N Number of elements to write
data_type character data type (enum matio_types)
Returns:
number of bytes written

void WriteInfo5 ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable

int WriteStructField ( mat_t mat,
matvar_t matvar 
)

Parameters:
mat MAT file pointer
matvar pointer to the mat variable
Return values:
0 on success


Generated on Tue May 26 18:16:12 2009 for LIBMATIO API by  doxygen 1.4.7