Chapter 9. Errors and Pitfalls
Even experienced programmers seldom have programs run correctly the first time. In computer jargon, an error in a program is a bug. The story is that a hapless moth short-circuited two thermionic valves in one of the earliest computers. This primeval (charcoaled) “bug” took days to find. The process of detecting and correcting errors is therefore called debugging.
There are many types of errors and pitfalls, some that are peculiar to MATLAB and some that may occur when programming in any language. These are discussed briefly in this chapter.
Syntax errors are typing mistakes in MATLAB statements (e.g., plog ...