mexEvalString (C and Fortran) - Execute MATLAB® command in caller's workspace

C Syntax

#include "mex.h"
int mexEvalString(const char *command);

Fortran Syntax

integer*4 mexEvalString(command)
character*(*) command

Arguments

command

A string containing the MATLAB command to execute

Returns

0 if successful, and a nonzero value if unsuccessful.

Description

Call mexEvalString to invoke a MATLAB command in the workspace of the caller.

mexEvalString and mexCallMATLAB both execute MATLAB commands. However, mexCallMATLAB provides a mechanism for returning results (left-hand side arguments) back to the MEX-file; mexEvalString provides no way for return values to be passed back to the MEX-file.

All arguments that appear to the right of an equal sign in the command string must already be current variables of the caller's workspace.

Examples

See mexevalstring.c in the mex subdirectory of the examples directory.

See Also

mexCallMATLAB

  


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