Programming and Data Types | ![]() ![]() |
What to Avoid When Running MATLAB
Performance acceleration is enabled only when you run your M-Files outside of debug mode and with command echoing turned off.
M-File Debug
The following debug commands, entered at the command prompt or within an M-File, disable MATLAB from accelerating any subsequent M-File code:
dbstop
if warning
dbstop if naninf
(or infnan
)
dbstop in mfile ...
dbstop if error
does not disable the performance accelerator.
The dbstop in mfile
command only affects the M-file (or M-files) in which dbstop
is set.
To turn off debug mode, and thus enable code acceleration, use the appropriate form of the dbclear
function.
Command Echoing
Enabling echoing (with the echo
function) for an M-file script or function disables performance acceleration for that script or function. Enabling echoing for all scripts or functions disables acceleration for all M-file scripts and functions.
Operating System Considerations
Depending on the degree to which your program code follows the acceleration guidelines described earlier in this section, your M-File programs should see a marked improvement in performance on all platforms. On Intel X86-based Linux and Windows systems, you are likely to see more of a performance gain than on other platforms.
![]() | How Vectorizing and Preallocation Fit In | Sample Accelerated Programs | ![]() |