External Interfaces Previous page   Next Page

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

typing

yields


Previous page  Handling Complex Data Handling Sparse Matrices Next page

© 1994-2005 The MathWorks, Inc.