MATLAB Functions | Help Desk |
echo
Echo M-files during execution
echo on echo off echo echoThefcnname
on echofcnname
off echofcnname
echo on all echo off all
echo
command controls the echoing of M-files during execution. Normally, the commands in M-files do not display on the screen during execution. Command echoing is useful for debugging or for demonstrations, allowing the commands to be viewed as they execute.
The echo
command behaves in a slightly different manner for script files and function files. For script files, the use of echo
is simple; echoing can be either on
or off
, in which case any script used is affected:echo
is more complicated. If echo
is enabled on a function file, the file is interpreted, rather than compiled. Each input line is then displayed as it is executed. Since this results in inefficient execution, use echo
only for debugging.function