Main Content

engGetVariable (Fortran)

Copy variable from MATLAB engine workspace

Fortran Syntax

#include "engine.h"
mwPointer engGetVariable(ep, name)
mwPointer ep
character*(*) name


engGetVariable reads the named mxArray from the MATLAB® engine session associated with ep. Returns 0 if successful and 1 if an error occurs.

The limit for the size of data transferred is 2 GB.

Use mxDestroyArray to destroy the mxArray created by this routine when you are finished with it.

Input Arguments

expand all

Pointer to engine, specified as mwPointer.

Name of mxArray to get from the MATLAB workspace, specified as character*(*).

Pointer to mxArray, specified as mwPointer.

Output Arguments

expand all

Pointer to a newly allocated mxArray structure, returned as mwPointer. Returns NULL if the attempt fails. engGetVariable fails if the named variable does not exist.

Introduced before R2006a