0% found this document useful (0 votes)
29 views

Assignment Problems: X X Sin X y X X X y

The document contains 7 questions asking to use MATLAB commands like plot, subplot, comet to plot different functions and parametric equations over given intervals. Key tasks include plotting multiple functions on the same axes with labels and titles, animating parametric plots using comet, using subplot to show two plots in separate axes, and using switch statements to plot different conic sections based on user input in separate subplots.

Uploaded by

Ali Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views

Assignment Problems: X X Sin X y X X X y

The document contains 7 questions asking to use MATLAB commands like plot, subplot, comet to plot different functions and parametric equations over given intervals. Key tasks include plotting multiple functions on the same axes with labels and titles, animating parametric plots using comet, using subplot to show two plots in separate axes, and using switch statements to plot different conic sections based on user input in separate subplots.

Uploaded by

Ali Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 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 ) = 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 )

( ) plot, display the function y ( x ) = Sin x from x = 20 to x = +20 , and in the


x
x
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 ) 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)).

You might also like