Unformatted text preview:

Eratta.doc Page 1 18-Jun-00ErattaThe following list contains corrections to be applied to MATLABProgramming for Engineers at the first re-printing. Corrections are shown inred below.[Pages 113-114, Exercise 3.11] Output Power from a Motor The outputpower produced by a rotating motor is given by the equationmPωτ IND= (3-10)where INDτ is the induced torque on the shaft in newton-meters, mω is therotational speed of the shaft in radians per second, and P is in watts. Assumethat the rotational speed of a particular motor shaft is given by the equation()rad/s 15.1882.0 tme−−=ωand the induced torque on the shaft is given bymN 102.0IND⋅=− teτPlot the torque, speed, and power supplied by this shaft versus time for 0 ≤ t ≤10 s. Be sure to label your plot properly with the symbols INDτ and mω.Create two plots, one with the power displayed on a linear scale, and one withthe output power displayed on a logarithmic scale. Time should always bedisplayed on a linear scale.[Page 153, Exercise 4.14] Write a MATLAB program to evaluate the functiony(x) = ln 11-xfor any user-specified value of x, where ln is the natural logarithm (logarithmto the base e). Write the program with a while loop, so that the programrepeats the calculation for each legal value of x entered into the program.When an illegal value of x is entered, terminate the program. [Any x ≥ 1 isconsidered an illegal value.]Eratta.doc Page 2 18-Jun-00[Pages 153-154, Exercise 4.15]Current Through a Diode The currentflowing through the semiconductor diode shown in Figure 4-4 is given by theequationiIeDoqvkTD=−æèçöø÷1 (4-13)where iD = the voltage across the diode, in voltsvD = the current flow through the diode, in ampsIO= the leakage current of the diode, in ampsq = the charge on an electron, 1.602 × 10-19 coulombsk = Boltzmann’s constant, 1.38 × 10-23 joule/KT = temperature, in kelvins (K)The leakage current IO of the diode is 2.0 µA. Write a program to calculate thecurrent flowing through this diode for all voltages from -1.0 V to +0.6 V, in0.1 V steps. Repeat this process for the following temperatures: 75 °F and 100°F, and 125 °F. Create a plot of the current as a function of applied voltage,with the curves for the three different temperatures appearing as differentcolors.[Page 197, Exercise 5.11]Use the Help Desk to look up information about thestandard MATLAB function sortrows, and compare the performance ofsortrows with the sort-with-carry function created in the previous exercise.To do this, create two copies of a 1000 × 2 element array containing randomvalues, and sort column 1 of each array while carrying along column 2 usingboth functions. Determine the execution times of each sort function using ticand toc. How does the speed of your function compare with the speed of thestandard function sortrows?Eratta.doc Page 3 18-Jun-00[Page 201, Exercise 5.19]Use function random0 to generate a set of threearrays of random numbers. The three arrays should be 100, 1000, and 2000elements long. Then, use functions tic and toc to determine the time that ittakes function ssort to sort each array. How does the elapsed time to sortincrease as a function of the number of elements being sorted? (Hint: On afast computer, you will need to sort each array many times and calculate theaverage sorting time in order to overcome the quantization error of the systemclock.)[Page 251, Exercise 6.5]Write a function that will accept a complex number c,and plots that point on a Cartesian coordinate system with a circular marker.The plot should include both the x and y axes, plus a vector drawn from theorigin to the location of c.[Page 252, Exercise 6.11]Create a mesh, surface plot, and contour plot of thefunction iyxez+= for the interval –1 ≤ x ≤ 1 and -2π ≤ y ≤ 2π. In each case,plot the real part of of z versus x and y.[Page 252, Exercise 6.17]MATLAB includes functions upper and lower,which shift a string to upper case and lower case respectively. Create a newfunction called caps, which capitalizes the first letter in each word, and forcesall other letters to be lower case. (Hint: Take advantage of functions upper,lower, and isspace.)[Page 325, Exercise 8.8]Table of Sines and Cosines Write a program togenerate a table containing the sine and cosine of θ for θ between 0° and 90°,in 1° increments. The program should properly label each of the columns inthe table.Eratta.doc Page 4 18-Jun-00[Page 349, Exercise 9.3]Write a program that modifies the default figure colorto orange and the default line width to 3.0 points. Then create a figure plottingthe ellipse defined by the equationsttx cos10)( =tty sin 6)( =[Page 414, Exercise 10.9]Modify the temperature conversion GUI of Exercise10.8 to allow you to adjust the displayed temperature by clicking the mouse.(Warning: This exercise requires material not discussed in this chapter.Refer to the WindowsButtonDownFcn property of figure objects and theCurrentPoint property of axis objects in the on-line


View Full Document

CORNELL CS 100 - Eratta

Download Eratta
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Eratta and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Eratta 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?