From: Balint Takacs on
Does anybody know whether mxGetCell() allocates memory, that is, its output mxArray* should be released by mxDestroy() after its use?

The documentation says that it is possible that the function fails because 'Insufficient free heap space to hold the returned cell mxArray'. However, it looks a bit weird and inefficient that a deep copy of the cell element is made upon simply accessing it.