Products & Services Industries Academia Support User Community Company

Learn more about MATLAB   

engPutVariable (C and Fortran) - Put variables into MATLAB engine workspace

C Syntax

#include "engine.h"
int engPutVariable(Engine *ep, const char *name, const mxArray 
     *pm);

Fortran Syntax

integer*4 engPutVariable(ep, name, pm)
mwPointer ep, pm
character*(*) name

Arguments

ep

Engine pointer

name

Name given to the mxArray in the engine's workspace

pm

mxArray pointer

Returns

0 if successful and 1 if an error occurs.

Description

engPutVariable writes mxArray pm to the engine ep, giving it the variable name name. 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.

The engine application owns the original mxArray and is responsible for freeing its memory. Although the engPutVariable function sends a copy of the mxArray to the MATLAB workspace, the engine application does not need to account for or free memory for the copy.

C Examples

UNIX[1] Operating Systems

See engdemo.c in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to call the engine functions from a C program.

Microsoft Windows Operating Systems

See engwindemo.c in the matlabroot/extern/examples/eng_mat folder for sample programs that illustrate how to call the engine functions from a C program for Windows systems.

See Also

engGetVariable


[1] UNIX is a registered trademark of The Open Group in the United States and other countries.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2009- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS