Documentation

This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Create or Delete Array

Create array of specified type, allocate and free memory

Use the mxCreate* functions to create MATLAB® arrays. Use the mxCallocmxMalloc, and mxRealloc functions to allocate dynamic memory.

You allocate memory whenever you use an mxCreate* function or when you call the mxCalloc and associated functions. Use mxDestroyArray to free memory allocated by the mxCreate* functions. Use mxFree to free memory allocated by the mxCalloc and associated functions.

C Functions

mxCreateDoubleMatrix 2-D, double-precision, floating-point array
mxCreateDoubleScalar Scalar, double-precision array initialized to specified value
mxCreateNumericMatrix 2-D numeric matrix
mxCreateNumericArray N-D numeric array
mxCreateUninitNumericMatrix Uninitialized 2-D numeric matrix
mxCreateUninitNumericArray Uninitialized N-D numeric array
mxCreateString 1-N array initialized to specified string
mxCreateCharMatrixFromStrings 2-D mxChar array initialized to specified value
mxCreateCharArray N-D mxChar array
mxCreateLogicalScalar Scalar, logical array
mxCreateLogicalMatrix 2-D logical array
mxCreateLogicalArray N-D logical array
mxCreateSparseLogicalMatrix 2-D, sparse, logical array
mxCreateSparse 2-D sparse array
mxCreateSparseLogicalMatrix 2-D, sparse, logical array
mxCreateStructMatrix 2-D structure array
mxCreateStructArray N-D structure array
mxCreateCellMatrix 2-D cell array
mxCreateCellArray N-D cell array
mxDestroyArray Free dynamic memory allocated by MXCREATE* functions
mxDuplicateArray Make deep copy of array
mxCalloc Allocate dynamic memory for array, initialized to 0, using MATLAB memory manager
mxMalloc Allocate uninitialized dynamic memory using MATLAB memory manager
mxRealloc Reallocate dynamic memory using MATLAB memory manager
mxFree Free dynamic memory allocated by mxCalloc, mxMalloc, mxRealloc, mxArrayToString, or mxArrayToUTF8String functions

Topics

Pass Strings

This example shows how to pass strings to a MEX file.

Was this topic helpful?