|MATLAB Function Reference|
Run a script
runs the MATLAB script specified by
scriptname contains the full pathname to the script file, then
run changes the current directory to be the one in which the script file resides, executes the script, and sets the current directory 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
addpath function to make a script executable by entering the script name alone.