| Contents | Index |
MLEvalString(command)
MLEvalString command
out = MLEvalString(command)
MLEvalString(command) passes a command string to the MATLAB software for evaluation. Use this syntax when working directly in a worksheet.
MLEvalString command passes a command string to the MATLAB software for evaluation. Use this syntax in a VBA macro.
out = MLEvalString(command) lets you catch errors when executing MLEvalString in a VBA macro. If MLEvalString fails, then out is a string containing error code or error message. Otherwise, out is 0.
The specified action alters only the MATLAB workspace. It has no effect on the Microsoft Excel workspace.
If MLEvalString fails, then by default you get a standard Spreadsheet Link EX error, such as #COMMAND. To return MATLAB error strings, use MLShowMatlabErrors.
command |
MATLAB command to evaluate. command in quotes directly specifies the command. command without quotes specifies a worksheet cell address (or range name) that contains the command. |
out |
0 if the command succeeded. Otherwise, a string containing error code or error message. To return MATLAB error messages instead of error code, use MLShowMatlabErrors. |
Divide the MATLAB variable b by 2, and then plot it:
MLEvalString("b = b/2;plot(b)")This command only modifies the MATLAB variable b. To update data in the Excel worksheet, use MLGetMatrix.
MLGetMatrix | MLShowMatlabErrors

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |