Anda di halaman 1dari 2

Assignment Problems

Answer all the following questions. You may work in groups of no more than two persons to complete this assignment. One copy of completed assignment is to be turned in by each group. 1. Use MATLABs plot command to draw the graphs of the functions below on the given interval. Label each axis and provide a title for your plot.
h( t ) = Cos ( 2t ) Sin( 2t ), [0,2 ] f ( x ) = 5 4 x x 2 , [ 6,2]

2. Use MATLABs plot command to draw the graph of both given functions on the same axes, drawn on the given interval. Label each axes. Provide a title and legend for your plot.
f ( x ) = xe 3 x , g ( x ) = e 3 x (1 3x ), [ 0,2] x ( t ) = (1 + 2Sint )cost , y( t ) = (1 + 2Sint )Sint , [ 0,2]

3. In each of the following questions, x and y are defined in terms of a parameter t on a given interval. Use MATLABs plot command to draw a plot of y versus x. Label each axis and provide a title for your plot.
x = t Sin ( t ), y = 1 Cos( t ), [0,6] x = t + 2 sin ( 2 t ), y = t + 2 cos( 5t ), [ 2,2]

4. Use comet command to animate the plots in question 3. 5. Use subplot function to create a figure that contains two plots. In the first subplot, display the function y( x ) = Sin ( x )

( ) second subplot, display the function y( x ) = cos x

from x = 20 to x = +20 , and in the

from x = 20 to x = +20 .

(you can ignore any divide-by-zero message). 6. Create a plot of the function f ( x , y ) = Sin ( x 2 + y 2 ) over the range of x = 0 to 2 and y = 0 to 3 . 7. Write a MATLAB program to compare the car emissions for various pollutants to given emission limits, taking the age of the car into consideration. Print Within emission limit if the emissions are within legal limits, else print Your car is a danger to the environment. The algorithm is as follows: The pollutant is selected by choosing an integer (pol_number) from a menu of the form: (1) Carbon Monoxide (2) Hydrocarbons

(3) Nitrogen Oxides (4) Non-methane Hydrocarbons The user is prompted to enter the emission (emission) in grams per mile. The user is prompted to enter the odometer reading (odom) and the year in which the car was manufactured (year_man). The entered values are compared to the limits given in the table below and the appropriate message is printed. First 5 years and Second 5 years or 50,000 miles second 50,000 miles Carbon Monoxide 3.4 gr/mile 4.2 gr/mile Hydrocarbons 0.31 gr/mile 0.39 gr/mile Nitrogen Oxides 0.4 gr/mile 0.5 gr/mile Non-methane Hydrocarbons 0.25 gr/mile 0.31 gr/mile (Source: Energy: Principles, Problems, Alternatives by Joseph Priest [Addison-Wesley, 1991]).

Anda mungkin juga menyukai