mxSetProperty (C and Fortran)
Set value of public property of MATLAB object
C Syntax
#include "matrix.h" void mxSetProperty(mxArray *pa, mwIndex index, const char *propname, const mxArray *value);
Fortran Syntax
#include "fintrf.h" subroutine mxSetProperty(pa, index, propname, value) mwPointer pa, value mwIndex index character*(*) propname
Arguments
paPointer to an
mxArraywhich is an object.indexIndex of the desired element of the object array.
In C, the first element of an
mxArrayhas anindexof0. Theindexof the last element isN-1, whereNis the number of elements in the array. In Fortran, the first element of anmxArrayhas anindexof1. Theindexof the last element isN, whereNis the number of elements in the array.propnameName of the property whose value you are assigning.
- value
Pointer to the
mxArrayyou are assigning.
Description
Use mxSetProperty to assign a value to
the specified property. In pseudo-C terminology, mxSetProperty performs
the assignment:
pa[index].propname = value;
Property propname must be an existing, public
property and index must be within the bounds of
the mxArray. To test the index value, use mxGetNumberOfElements or mxGetM and mxGetN functions.
mxSetProperty makes a copy of the value before assigning it as the new
property value. If the property uses a large amount of memory, then making a copy might
be a concern. There must be sufficient memory in the heap to hold the copy of the
value.
Limitations
mxSetPropertyis not supported for standalone applications, such as applications built with the MATLAB® engine API.Properties of type
datetimeare not supported.
Version History
Introduced in R2008a