| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "matrix.h" mxArray *mxGetProperty(const mxArray *pa, mwIndex index, const char *propname);
mwPointer mxGetProperty(pa, index, propname) mwPointer pa mwIndex index character*(*) propname
Pointer to an mxArray which is an object.
Index of the desired element of the object array.
In C, the first element of an mxArray has an index of 0. The index of the last element is N-1, where N is the number of elements in the array.
In Fortran, the first element of an mxArray has an index of 1. The index of the last element is N, where N is the number of elements in the array.
Name of the property whose value you want to extract.
Pointer to the mxArray of the specified propname on success. Returns NULL in C (0 in Fortran) if unsuccessful. Common causes of failure include:
Specifying a nonexistent propname.
Specifying a nonpublic propname.
Specifying a COM or Java object.
Specifying an index to an element outside the bounds of the mxArray. Use mxGetNumberOfElements or mxGetM and mxGetN to test the index value.
Insufficient memory (in the heap) to hold the returned mxArray.
Call mxGetProperty to get the value held in the specified element. In pseudo-C terminology, mxGetProperty returns the value at:
pa[index].propname
mxSetProperty, mxGetNumberOfElements, mxGetM, mxGetN
![]() | mxGetPr (C and Fortran) | mxGetScalar (C and Fortran) | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |