run
Run MATLAB script
Syntax
Description
run(
runs
the MATLAB® script specified by scriptname
)scriptname
.
Examples
Input Arguments
Tips
To update the output when running live scripts, use the Run button in the Live Editor tab instead of the
run
function. Therun
function does not update live scripts with new output.If you edit a script using an external editor, call
clear scriptname
in between calls to therun
function in the same MATLAB session to make sure that the changed script is run. If a script is not on the MATLAB path,run
caches the script when running it. Callingclear scriptname
clears the cached version of the script and forces therun
function to use the changed version of the script. If you edit the script with the MATLAB Editor, therun
function always runs the changed version and there is no need to callclear scriptname
.run
changes to the folder that contains the script, executes it, and resets back to the original folder. If the script itself changes folders, thenrun
does not revert to the original folder, unlessscriptname
changes to the folder in which this script resides.
Version History
Introduced before R2006a