This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Evaluate MATLAB command given Microsoft Excel data


= matlabfcn(command,inputs)



= matlabfcn(command,inputs) specifies the MATLAB® command for evaluation in the MATLAB workspace, given the input data inputs. Depending upon the MATLAB output, matlabfcn returns a single value or string into the calling worksheet cell. If the result contains more than one value in MATLAB, only the first value in the array returns in the calling worksheet cell. Use this syntax when working in a worksheet cell.


collapse all

Using std, find the maximum likelihood estimate of the standard deviation of data in worksheet cells A1 through A10. Assume that the data comes from a normal population. Specify a weight of one in cell C1. Return the result by entering this text into cell A12.


Cell A12 displays the maximum likelihood estimate of the standard deviation.

Input Arguments

collapse all

MATLAB command to evaluate, specified as a string. Enclose the string in double quotes. Or, enter the string in a cell without quotes and enter the corresponding cell reference without quotes as the input argument.

Example: "sum"

Example: A1

MATLAB command input arguments, specified as an Excel cell reference or a reference to a range of cells. To specify multiple input arguments for a function, separate the cell references with commas.

Example: B1:B10

Example: A1:C1,A3


  • If matlabfcn fails, a standard Spreadsheet Link™ error displays by default; for example, #COMMAND. To return MATLAB errors, use MLShowMatlabErrors.

Introduced before R2006a

Was this topic helpful?