Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica >
MATHEMATICA LIBRARYLINK C FUNCTION|Tutorials »

MTensor_new


is a library callback function that creates a new MTensor.
  • Used in C/C++ code in a library function called from Mathematica.
  • A nonzero error code value will be returned if the dimensions are negative or there is not sufficient memory.
This creates a 5×5 MTensor of doubles:
This creates a 5×5 MTensor of doubles:
MTensor T0;
mint type = MType_Real;
mint dims[2];
mint rank = 2;
int err;
...
dims[0] = 5;
dims[1] = 5;
err = libData->MTensor_new( type, rank, dims, &T0);
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF