MATLAB Application Program Interface
  Go to function:
    Search    Help Desk 
matGetString    Examples

Copy character mxArrays from MAT-files

Fortran Syntax

Arguments

mfp
  Pointer to MAT-file information.

name
  Name of mxArray to get from MAT-file.

str
  Character array to read from MAT-file.

strlen
  Length of the character array.

Description

matGetString reads the character mxArray with the specified name into str from the MAT-file mfp. It returns zero if successful, and a nonzero value if an error occurs.

matGetString copies the character array from mxArray name on file mfp into the character array str.

Only up to strlen characters are copied, so ordinarily strlen is set to the dimension of the character array to prevent writing past the end of the array. If the character mxArray contains several rows, they are copied, one column at a time, into one long character array.

matGetString returns 0 if the copy is successful, and 1 if the copy has failed because the mxArray is not a character mxArray, 2 if the length of the character array exceeds strlen, and 3 if there is a file read error.

Example

Then you can go to MATLAB and enter:



[ Previous | Help Desk | Next ]