Import current MATLAB figure into Microsoft Excel spreadsheet
MLGetFigure width, height
out = MLGetFigure(width,height)
MLGetFigure(width,height) import the current MATLAB® figure into an Excel® worksheet, where the top-left corner of the figure is the current spreadsheet cell. Use this syntax when working directly in a worksheet.
Width (in normalized units) of the MATLAB figure when imported into an Excel worksheet.
Height (in normalized units) of the MATLAB figure when imported into an Excel worksheet.
Import the current MATLAB figure into an Excel worksheet. Specify the width and the height of the figure to be half those of the original figure:
Note that if you use Microsoft® Excel 2007 or 2010, the width and the height of the imported figure will be a quarter of those of the original figure.
If worksheet calculation mode is automatic, MLGetFigure executes when you enter the formula in a cell. If worksheet calculation mode is manual, enter the MLGetFigure function in a cell, then press F9 to execute it. Remember that pressing F9 in this situation can also execute other worksheet functions again and generate unpredictable results.
If you use MLGetFigure in a macro subroutine, enter MatlabRequest on the line after the MLGetFigure. MatlabRequest initializes internal Spreadsheet Link™ EX variables and enables MLGetFigure to function in a subroutine. Do not include MatlabRequest in a macro function unless the function is called from a subroutine.