Main Content

mxCreateCharMatrixFromStrings (Fortran)

2-D mxChar array initialized to specified value

Fortran Syntax

#include "fintrf.h"
mwPointer mxCreateCharMatrixFromStrings(m, str)
mwSize m
character*(*) str(m)

Description

Use mxCreateCharMatrixFromStrings to create a two-dimensional mxArray, where each row is initialized to a string from str. The mxArray has dimensions m-by-n, where n is the number of characters in str(i).

Input Arguments

expand all

Number of strings, specified as mwSize.

Array of strings, specified as character*n array of size m, where each element of the array is n bytes.

Output Arguments

expand all

Pointer to an mxArray of type mxChar, specified as mwPointer.

The function is unsuccessful when str contains fewer than m strings or there is not enough free heap space to create the mxArray.

  • MEX file — Function terminates the MEX file and returns control to the MATLAB® prompt.

  • Standalone (non-MEX file) application — Function returns 0.

Version History

Introduced before R2006a