MATLAB Application Program Interface
  Go to function:
    Search    Help Desk 
mxGetPr    Examples   See Also

Get an mxArray's real data elements

C Syntax

Arguments

array_ptr
  Pointer to an mxArray.

Returns

The address of the first element of the real data. Returns NULL if there is no real data.

Description

Call mxGetPr to determine the starting address of the real data in the mxArray that array_ptr points to. Once you have the starting address, it is fairly easy to access any other element in the mxArray.

Examples

Consider a MEX-file named DispReal that displays the value of every real element in the input mxArray

In MATLAB, create Values:

Pass Values as an argument to DispReal

For additional examples, see mxgetpr.c and mxgetpr2.c in the mx subdirectory of the examples directory.

See Also

mxGetPi, mxSetPi, mxSetPr



[ Previous | Help Desk | Next ]