#include "mex.h" Matrix *mexGetMatrixPtr(name)
char *name;
integer*4 function mexGetMatrixPtr(name)
character*(
*) name
name
In computer science terminology, mexGetMatrix
does a "get by value" whereas mexGetMatrixPtr
does a "get by reference."
Do not free or reallocate the memory associated with any part of a Matrix obtained with this function, including the real part, imaginary part, and sparse structure. Matrices obtained with this function are managed by MATLAB's own internal mechanisms and MATLAB will crash immediately if you change anything.
This function can be used to read the values from a Matrix in the workspace, or to changes those values, provided the Matrix remains the same size, complexity, and sparsity.
To get the pointer of a global variable that is not defined as global by the calling function, first declare it global with a call of the form mexEvalString("global varname")
.
(c) Copyright 1994 by The MathWorks, Inc.