Main Content

mxSetComplexUint32s (C)

Set complex data elements inmxUINT32_CLASSarray

C Syntax

#include "matrix.h" int mxSetComplexUint32s(mxArray *pa, mxComplexUint32 *dt);

Description

UsemxSetComplexUint32sto setmxUint32data of the specifiedmxArray.

AllmxCreate* functions allocate heap space to hold data. Therefore, you do not ordinarily use this function to initialize the elements of an array. Rather, call this function to replace the existing values with new values.

Input Arguments

expand all

Pointer to anmxUINT32_CLASSarray.

Pointer to the firstmxComplexUint32element of the data array.dtmust be allocated by the functionsmxCallocormxMalloc.

Output Arguments

expand all

Function status, returned asint. If successful, then the function returns1.

IfpaisNULL, then the function returns0.

The function is unsuccessful whenmxArrayis not an unsharedmxUINT32_CLASSarray, or if the data is not allocated withmxCalloc. If the function is unsuccessful, then:

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

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

Examples

Refer to thearrayFillSetComplexPr.cexample in thematlabroot/extern/examples/refbookfolder which copies existing complex numeric data into anmxArray. The data in the example is defined asmxComplexDouble. You can use this example as a pattern for any complex C numeric type. To modify this example for complexuint32data:

  • Declare the data variables asmxComplexUint32

  • CallmxCreateNumericMatrixwith the numeric typemxUINT32_CLASS

  • ReplacemxSetDoubleswithmxSetComplexUint32sto put the C array into anmxArray

API Version

This function is available in the interleaved complex API. To buildmyMexFile.cusing this function, type:

mex-R2018amyMexFile.c
Introduced in R2018a