matlab mxsetpi函数语法

发表matlab mxsetpi函数相关文章
一句话说明: Set new imaginary data elements in array of type DOUBLE

mxSetPi (C and Fortran)

Set new imaginary data elements in array of type DOUBLE

C Syntax

#include "matrix.h"
void mxSetPi(mxArray *pm, double *pi);

Fortran Syntax

subroutine mxSetPi(pm, pi)
mwPointer pm, pi



Pointer to a full (nonsparse) mxArray


Pointer to the first element of an array. Each element in the array contains the imaginary component of a value. The array must be in dynamic memory; call mxCalloc to allocate this memory. Do not use the ANSI® C calloc function, which can cause memory alignment issues leading to program termination. If pi points to static memory, memory leaks and other memory errors might result.


Use mxSetPi to set the imaginary data of the specified mxArray.

Most mxCreate* functions optionally allocate heap space to hold imaginary data. If you tell an mxCreate* function to allocate heap space—for example, by setting the ComplexFlag to mxCOMPLEX in C (1 in Fortran) or by setting pi to a non-NULL value in C (a nonzero value in Fortran)—you do not ordinarily use mxSetPi to initialize the created mxArray's imaginary elements. Rather, you call mxSetPi to replace the initial imaginary values with new ones.

This function does not free any memory allocated for existing data that it displaces. To free existing memory, call mxFree on the pointer returned by mxGetPi before you call mxSetPi.


See the following examples in matlabroot/extern/examples/mx.

See Also

mxGetPi, mxGetPr, mxSetImagData, mxSetPr, mxFree


与matlab mxsetpi用法相关的文章

友情链接It题库(| 版权归yishouce.com所有| 友链等可联系|粤ICP备16001685号-1