matlab mxsetdata函数语法

发表matlab mxsetdata函数相关文章
一句话说明: Set pointer to real numeric data elements in array

mxSetData (C and Fortran)

Set pointer to real numeric data elements in array

C Syntax

#include "matrix.h"
void mxSetData(mxArray *pm, void *pr);

Fortran Syntax

subroutine mxSetData(pm, pr)
mwPointer pm, pr

Arguments

pm

Pointer to an mxArray

pr

Pointer to an array. Each element in the array contains the real 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.

Description

mxSetData is like mxSetPr, except that in C, its second argument is a void *. Use this function on numeric arrays with contents other than double.

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 mxGetData before you call mxSetData.

Examples

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

See Also

mxCalloc, mxFree, mxGetData, mxSetPr

欢迎转载,转载请注明来自一手册:http://yishouce.com/matlab/func/mxsetdata

与matlab mxsetdata用法相关的文章

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