| MATLAB Application Program Interface | Search  Help Desk |
| engPutArray | Examples |
Put variables into a MATLAB engine's workspace
C Syntax
#include "engine.h" int engPutArray(Engine *ep, const mxArray *mp);
Arguments
ep
mp
Description
This routine allows you to put variables into a MATLAB engine's workspace.engPutArray writes mxArray mp to the engine ep. If the mxArray does not exist in the workspace, it is created. If an mxArray with the same name already exists in the workspace, the existing mxArray is replaced with the new mxArray.
engPutArray returns 0 if successful and 1 if an error occurs. In V4 compatibility mode, engPutArray will fail if the mxArray mp is not a MATLAB 4 data type.
Example
(UNIX) Seeengdemo.c in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to call the MATLAB engine functions from a C program.
(Windows) See engwindemo.c in the eng_mat subdirectory of the examples directory for a sample program that illustrates how to call the MATLAB engine functions from a C program for Windows.