Page 32 - Numerical Analysis Using MATLAB and Excel
P. 32
Multiplication, Division and Exponentiation
111
Full Screen Default
211 221 222 121 122
212 223 224
221 222 211 221 122 121 222
212 223 224 223 224
Figure 1.7. Possible subpot arrangements in MATLAB
1.8 Multiplication, Division and Exponentiation
MATLAB recognizes two types of multiplication, division, and exponentiation. These are the
matrix multiplication, division, and exponentiation, and the element−by−element multiplication,
division, and exponentiation. They are explained in the following paragraphs.
In Section 1.2, the arrays a b c … ] , such a those that contained the coefficients of polynomi-
[
als, consisted of one row and multiple columns, and thus are called row vectors. If an array has
one column and multiple rows, it is called a column vector. We recall that the elements of a row
vector are separated by spaces. To distinguish between row and column vectors, the elements of a
column vector must be separated by semicolons. An easier way to construct a column vector, is to
write it first as a row vector, and then transpose it into a column vector. MATLAB uses the single
quotation character (¢) to transpose a vector. Thus, a column vector can be written either as
b=[−1; 3; 6; 11]
or as
b=[−1 3 6 11]'
MATLAB produces the same display with either format as shown below.
b=[−1; 3; 6; 11]
b =
-1
3
6
11
b=[−1 3 6 11]'
b =
-1
3
Numerical Analysis Using MATLAB® and Excel®, Third Edition 1−19
Copyright © Orchard Publications