Skip to Main Content Skip to Search
Product Documentation

MLStartDir - Specify MATLAB current working folder after startup

Syntax

MLStartDir(path)
MLStartDir path
out = MLStartDir(path)

Description

MLStartDir(path) sets the MATLAB working folder after startup. Use this syntax when working directly in a worksheet.

MLStartDir path sets the MATLAB working folder after startup. Use this syntax in a VBA macro.

out = MLStartDir(path) lets you catch errors when executing MLStartDir in a VBA macro. If MLStartDir fails, then out is a string containing error code. Otherwise, out is 0.

Tips

Input Arguments

path

Path to the new MATLAB working folder after startup.

Output Arguments

out

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

Examples

Specify MATLAB Working Folder

Set the MATLAB working folder to d:\work after startup:

MLStartDir ("d:\work")

Specify MATLAB Working Folder That Includes Spaces

If your folder path includes a space, embed the path in single quotation marks within double quotation marks.

Set the MATLAB working folder to d:\my work:

MLStartDir ("'d:\my work'")

See Also

MLAutoStart

  


Recommended Products

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