| Products & Services | Industries | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → MATLAB |
| Contents | Index |
| Learn more about MATLAB |
#include "mex.h" int mexEvalString(const char *command);
integer*4 mexEvalString(command) character*(*) command
0 if successful, and a nonzero value if unsuccessful.
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.
If command detects an error, MATLAB terminates the MEX-file and returns control to the MATLAB prompt. If you want to trap errors, use the mexEvalStringWithTrap function.
See mexevalstring.c in the matlabroot/extern/examples/mex folder .
mexCallMATLAB, mexEvalStringWithTrap
![]() | mexErrMsgTxt (C and Fortran) | mexEvalStringWithTrap (C and Fortran) | ![]() |

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 |