Assignment Problems: X X Sin X y X X X y
Assignment Problems: X X Sin X y X X X y
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 ) = Sin ( 2 t )Cos( 2 t ), [0,2] 2. Use MATLABs plot command to draw the graph of both given functions on the f ( x ) = 5 4 x x 2 , [ 6,2]
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 3 x ), [ 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 ( 2t ), 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 subsecond subplot, display the function y ( x ) = cos( x )
(you can ignore any divide-by-zero message). 6. Create a plot of the function f ( x , y ) = Sin( x 2 + y 2 ) Cos( x 2 + y 2 ) over the range of x = 0 to 2 and y = 0 to 3 . 7. The equations for various conics and the values of x to be used while plotting them are given below: 1) 2) 3) 4) Circle: Hyperbola: Parabola Ellipse y = sqrt(16 x^2) y = sqrt(x^2 16) y = sqrt(4 * (x 6)) y = sqrt(1 (x^2)/4) where -4 < x < 4 where 4 < x < 8 where 6 < x <10 where 2 < x < 2
Write a program in MATLAB to accept an integer representing the conic section to be plotted. Using subplot(2,2,I), where I is the value given by the user and a switch statement, plot the equation in the appropriate subplot. (e.g. A parabola would be plotted using subplot(2,2,3)).