# mxCreateFull, mxCreateSparse, mxFreeMatrix

## Purpose

`Allocate and free Matrices.`

## C Synopsis

    Matrix *mxCreateFull(m,n,ComplexFlag)
      int m, n;
      int ComplexFlag;
    Matrix *mxCreateSparse(m,n,nzmax,ComplexFlag)
      int m, n;
      int nzmax;
      int ComplexFlag;
    void mxFreeMatrix(Matrix *pm)
      Matrix *pm

## Fortran Synopsis

    integer*4 function mxCreateFull(m,n,ComplexFlag)
    integer*4 function mxCreateSparse(m,n,nzmax,ComplexFlag)
    subroutine mxFreeMatrix(pm)
    integer*4 pm,m,n,nzmax,ComplexFlag

## Arguments

`ComplexFlag`
  complex flag, either `REAL = 0` or `COMPLEX = 1`
`m`
  number of rows in the Matrix
`n`
  number of columns in the Matrix
`nzmax`
  number of nonzero elements in the sparse Matrix
`pm`
  pointer to the Matrix structure

## Description

These routines allow you to create and destroy full and sparse Matrices of a specified size. They return pointers to newly allocated Matrices and free existing Matrices.

`mxFreeMatrix` returns a Matrix structure to the heap for reuse, freeing any arrays (`pr`, `pi`, `ir`, or `jc`) allocated within the Matrix structure.

(c) Copyright 1994 by The MathWorks, Inc.