Lab 5 deals with Chapter 4 of Gilat (which has... focusing on formatting output in Matlab.

advertisement
Lab 5 deals with Chapter 4 of Gilat (which has not been done in recent years!)
focusing on formatting output in Matlab.
g5c4p126x13: No formatting is required in the problem, though students can use
fprintf (pp104-107) to give an explanation with your answer. The hard part here
is setting up the formula to relate a and b. If students need a hint, please draw
the diagonal of the rectangle (find the right triangle with lengths a, b, and 110). In
MATLAB, define the vector a, use the formula to calculate (element-by-element!)
vector b, then a vector for the area of the rectangle (NOTE that A = (a-8)*(b20)). Refer to p76 or the help menu for the max command.
g5c4p129x21 (fprintf): DO NOT WORRY ABOUT INPUTTING THE
POINTS! Script files with user input do not publish. Instead, just define the
coordinates (x1, y1, x2, etc) in the script file. NOTE that the first matrix is a 2x2
matrix, NOT (x1-x2)*(y1-y2) and so on! And you solved a system of equations
last week (g5c3p093x33). Once solve for Cx and Cy, use the fprintf command
(pp104-107) to create the desired mix of text and output.
g5c4p130x23 (disp, fprintf): Solve the system of equations as before (NOTE A is
a 13x13 matrix, which would be rather unlucky to attempt to solve by hand! :). To
display the table, use the disp command (example on pp102-103) or fprintf to
format the output (see example on pp109-110, but ignore the "fid1" and "fid2"
variables). Note that the first column of the table is just 1:1:13.
s517x45: Similar to last week's problem (s517x48). Obviously, you cannot ezplot
from 0 to infinity; just plot from 0 to 10. (They CAN, however, use infinity as a
boundary on the integral command-see the help menu for details).
s553x26: See bottom of p370 for how to use ezplot on parametrized curves. Plot
the curve, then integrate 2*pi*y*sqrt(x'(t)^2 + y'(t)^2) from 0 to pi to find the
surface area (the double command will be required here as well). All derivatives
and integrals should be done in MATLAB.
Also please look at the Maplets for the week on Arclength and Surface Area
Download