External Interfaces/API    

Dynamically Allocating Memory

It is possible to allocate memory dynamically in a Fortran MEX-file, but you must use %val to do it. This example takes an input matrix of real data and doubles each of its elements.

This is the subroutine that dblmat calls to double the input matrix.

For an input 2-by-3 matrix



  Handling Complex Data Handling Sparse Matrices