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 118: the third command has two typographical errors
(Thanks to Rapaport Eliezer.)
» kk(1:2:end) = pi % insert a noninteger value!
Kkk =
should read
» kkk(1:2:end) = pi % insert a noninteger value!
kkk =
- 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 227: the comment in the last line of code on the page refers
to the wrong variable (thanks to Fréderique Lotin).
yname=inputname(2); % get x argument name if it exists
should read
yname=inputname(2); % get y argument name if it exists
- 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 314: the size of yi has an extraneous digit.
(Thanks to Fréderique Lotin.)
» size(yi) % result is all three columns interpolated
ans =
100 31
should read
» size(yi) % result is all three columns interpolated
ans =
100 3
- pages 318 and 319: the indices for xmax and
ymax were switched,
(thanks to Dr. A. E. Bryson.)
» xmax = xi(j)
should read
» xmax = xi(i)
and on page 319:
» ymax = yi(i)
should read
» ymax = yi(j)
- page 321: the tsearch and dsearch arguments
have misplaced decimal points,
(thanks to Dr. A. E. Bryson.)
» tsearch(x,y,tri,[-.5 1],[.1 .5])
and
» dsearch(x,y,tri,[-.5 1],[.1 .5])
should read
» tsearch(x,y,tri,[-.5 .1],[1 .5])
and
» dsearch(x,y,tri,[-.5 .1],[1 .5])
- page 333: the second linestyle argument for the plot
command should be -- to generate a dashed line.
(Thanks to Fréderique Lotin.)
» plot(x,y,'-o',xi,yi,'-')
should read
» plot(x,y,'-o',xi,yi,'--')
- page 621: the help text is incorrect. The arguments to an
assignment operator must match in size (thanks to Matthew Fig).
The line
% c(i)=sum(A(i)==B);
should read
% c(i)=sum(A(i)==B(:));
- 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)));