Main Content

MLClose

停止MATLAB

Syntax

= MLClose()
MLClose
out = MLClose()

Description

= MLClose()ends the MATLAB®process, deletes all variables from the MATLAB workspace, and tells theMicrosoft®Excel®software that the MATLAB software is no longer running.Use this syntax when working directly in a worksheet.

MLCloseends the MATLAB process, deletes all variables from the MATLAB workspace, and tells theMicrosoft Excelsoftware that the MATLAB software is no longer running.Use this syntax in a VBA macro.

out= MLClose()lets you catch errors when executingMLClosein a VBA macro. IfMLClosefails, thenoutis a string containing error code. Otherwise,outis0.

Output Arguments

out

0if the command succeeded. Otherwise, a string containing error code.

Examples

collapse all

End the MATLAB session from a worksheet:

MLClose()

Tips

  • If you useMLClosewhen no MATLAB process is running, nothing happens.

  • To work with VBA code in Excel with Spreadsheet Link™, you must enable Spreadsheet Link as a reference in theMicrosoft Visual Basic®Editor. For details, seeInstallation.

Version History

Introduced before R2006a