Mastering MATLAB 7 Errata
Here's the errata for the first edition of Mastering MATLAB 7. Corrections
are listed in page order.
If you find any content or typographical errors not listed here, please
contact the authors so we can update
this list. Thanks.
- page 6: just before Section 2.2, the command
help precendence
should read
help precedence
- page 18: the entries in the Trigonometric Function table with
arguments in degrees are missing the trailing d in the function
name. (Thanks to Jack Albers.)
| cos | Cosine with argument in degrees |
| cot | Cotangent with argument in degrees |
| csc | Cosecant with argument in degrees |
| sec | Secant with argument in degrees |
| sin | Sine with argument in degrees |
| tan | Tangent with argument in degrees |
should read
| cosd | Cosine with argument in degrees |
| cotd | Cotangent with argument in degrees |
| cscd | Cosecant with argument in degrees |
| secd | Secant with argument in degrees |
| sind | Sine with argument in degrees |
| tand | Tangent with argument in degrees |
- page 19: the cartpol entry in the Coordinate
Transformation Function table is missing the 2. (Thanks to
Onder Eker.)
| cartpol | Cartesian to cylindrical or polar |
should read
| cart2pol | Cartesian to cylindrical or polar |
- page 41: the vector y actually contains 11 elements.
Therefore, the following example in the middle of the page is incorrect.
(Thanks to Mark Stephenson.)
» y(11)
??? Index exceeds matrix dimensions.
should read
» y(12)
??? Index exceeds matrix dimensions.
- page 65: in the first paragraph, the word columns should be
rows.
(Thanks to Brad Budlong.)
reveals that you can place the second and third columns of
A...
should read
reveals that you can place the second and third rows of
A...
- page 72: the last example has the wrong sign.
(Thanks to Brad Budlong.)
» y = B(x) % grab True values
y =
5
-3
4
should read
» y = B(x) % grab True values
y =
5
-3
-4
- page 105: the third sub2ind example comments are
incorrect. (Thanks to Hendrik Boshoff.)
» sub2ind(size(F),1,2,3) % 1st element, 2nd column...
should read
» sub2ind(size(F),1,2,3) % 1st row, 2nd column...
- page 156: at the bottom of the page, the second argument to
rmfield should be a character array or a cell array of strings. The
example returns a list which is incorrect. (Thanks to Enrique
Pacheco-Cabrera.)
» circle3 = rmfield(circle,fnames{1:3})
should read
» circle3 = rmfield(circle,fnames(1:3))
- page 194: the operator for the short-circuiting logical OR is
|| rather than | as shown in the table.
(Thanks to Onder Eker.)
| Short-circuiting logical OR (|) | Lowest |
should read
| Short-circuiting logical OR (||) | Lowest |
- page 211: the formulas for two of the conversions are incorrect
in the switch/case block.
The meter to centimeter conversion requires a multiplication while the
millimeter to centimeter conversion requires a division. (Thanks to Lynden
Mahrt for catching this one.)
case {'meter','m'}
y = x/100;
case {'millimeter','mm'}
y = x*10;
should read
case {'meter','m'}
y = x*100;
case {'millimeter','mm'}
y = x/10;
- page 227: the fourth line of code (containing
Tar) should be at the end of the preceding comment line. The
line word-wrapped inappropriately.
- page 227: the line of code beginning with exist should
move to the right; it should be aligned vertically with the preceding and
following lines of code.
- page 282: the vector b should be y,
Therefore, the following statement in the middle of the page is incorrect.
(Thanks to a reader from AOL.)
» x=A\b % solution with maximum zero elements
should read
» x=A\y % solution with maximum zero elements
- page 685: in the function whoami, the lines that display
the data are incorrect. The variables myname and myip are
Java Strings. The sprintf function needs character strings.
Therefore, the strings must be explicitly converted for printing. (Thanks to
Desi Dimova for catching the typo in the text.)
disp(sprintf('My host name is %s',myname));
disp(sprintf('My IP address is %s',myip));
should read
disp(sprintf('My host name is %s',char(myname)));
disp(sprintf('My IP address is %s',char(myip)));