Skip to Main Content Skip to Search
Product Documentation

run - Run script that is not on current path

Syntax

run scriptname

Description

run scriptname runs the MATLAB script specified by scriptname. If scriptname contains the full pathname to the script file, then run changes the current folder to be the one in which the script file resides, executes the script, and sets the current folder back to what it was. The script is run within the caller's workspace.

run is a convenience function that runs scripts that are not currently on the path. Typically, you just type the name of a script at the MATLAB prompt to execute it. This works when the script is on your path. Use the cd or addpath function to make a script executable by entering the script name alone.

See Also

addpath | cd

  


Free MATLAB Interactive Kit

Explore how to use MATLAB to make advancements in engineering and science.


Download free kit

Trials Available

Try the latest version of MATLAB and other MathWorks products.


Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS