| Contents | Index |
matlabsub(command,edat,inputs)
matlabsub(command,edat,inputs) passes the specified command to the MATLAB workspace for evaluation, given the function input data. The function returns a single value or string depending upon the MATLAB output. This function is intended for use as an Excel worksheet function.
To return an array of data to the Microsoft Excel Visual Basic for Applications (VBA) workspace, see MLEvalString and MLGetVar.
edat must not include the cell that contains the matlabsub function. In other words, be careful not to overwrite the function itself.
Ensure that there is enough room in the worksheet to write the matrix contents. If there is insufficient room, the function generates a fatal error.
If matlabsub fails, then by default you get a standard Spreadsheet Link EX error, such as #COMMAND. To return MATLAB error strings, use MLShowMatlabErrors.
Sum the data in worksheet cells B1 through B10 returning the output to cell A1:
matlabsub("sum", "A1", B1:B10)
matlabfcn | 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 |