# Category Archive for: Programming with MATLAB

Relational Operators and Logical Variables MATLAB has six relational operators to make comparisons between arrays. These operators are shown in Table 4.2-1 and were introduced in Section 1.3. Recall that the equal to operator consists of two = signs, not a single = sign as you might expect. The single =sign is the assignment, or replacement, operator in MATLAB.…

Logical Operators and Functions MATLAB has five logical operators, which are sometimes called Boolean operators (see Table 4.3-1). These operators perform element-by-element operations. With the exception of the NOT operator (-), they have a lower precedence than the arithmetic and relational operators (see Table 4.3-2). The NOT symbol is called the tilde. The NOT operation -A returns an array of…

Program Design and Development In Chapter 1 we introduced relational operators, such as > and =>. and the two types of loops used in MATLAB, the for loop and the while loop. These features, plus MATLAB functions and the logical operators to be introduced in Section 4.3, form the basis for constructing MATLAB programs to solve complex problems. Design…

Problems You can find answers to problems marked with an asterisk at the end of the text. Section 4.1 1. The volume V and surface area A of a sphere of radius r are given by                                      …