M-File Help: runscript

M-File Help: runscript | View code for runscript

# runscript

Run an M-file in interactive fashion

runscript(fname, options) runs the M-file fname and pauses after every executable line in the file until a key is pressed. Comment lines are shown without any delay between lines.

## Options

'delay', D | Don't wait for keypress, just delay of D seconds (default 0)
'cdelay', D | Pause of D seconds after each comment line (default 0)
'begin' | Start executing the file after the comment line %%begin (default false)
'dock' | Cause the figures to be docked when created
'path', P | Look for the file FNAME in the folder P (default .)
'dock' | Dock figures within GUI

## Notes

- If no file extension is given in FNAME, .m is assumed.
- If the executable statement has comments immediately afterward (no blank lines) then the pause occurs after those comments are displayed.
- A simple '-' prompt indicates when the script is paused, hit enter.
- If the function cprintf() is in your path, the display is more colorful, you can get this file from MATLAB Central.
- If the file has a lot of boilerplate, you can skip over and not display it by giving the 'begin' option which searchers for the first line starting with %%begin and commences execution at the line after that.

## See also

eval

© 1990-2014 Peter Corke.