Chapter 11

Errors and Pitfalls

Abstract

The objective of this chapter is to begin to learn to recognize and avoid different sorts of errors and pitfalls. Even experienced programmers seldom get programs to run correctly the first time. In computer jargon, an error in a program is called a bug. The process of detecting and correcting such errors is therefore called debugging. There are a number of different types of errors and pitfalls, some of which are peculiar to MATLAB, and some of which may occur when programming in any language. These are discussed briefly in this chapter.

Keywords

Bugs; Debugging; Syntax and logical errors; Run-time errors

Get Essential MATLAB for Engineers and Scientists, 6th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.