LibraryLink`
LibraryLink`MNumericArray_getData (C Function)
gets a void pointer to an array of the data elements of an MNumericArray.
Examples
Basic Examples (1)
This iterates over the data elements of an MNumericArray:
MNumericArray A;
numericarray_data_t type;
unsigned char* data;
mint i, len;
...
len = libData->numericarrayLibraryFunctions->MNumericArray_getFlattenedLength(A);
type = libData->numericarrayLibraryFunctions->MNumericArray_getType(A);
if (type == MNumericArray_Type_Ubit8) {
data = (unsigned char*)(libData->numericarrayLibraryFunctions->MNumericArray_getData(A));
for (i = 0; i < len; i++) {
unsigned char elem = data[i];
...
}
}