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

Assignment Problems: T e T H X X X F

This document contains 8 questions asking the student to: 1. Plot various functions using MATLAB and label the axes and title. 2. Plot multiple functions on the same axes with a title and legend. 3. Plot x versus y for parametric functions, labeling the axes and titling the plot. 4. Animate the parametric plots using the comet command. 5. Create a subplot with sine and cosine plots from -20 to 20. 6. Plot a 3D surface plot. 7. Write a program to print the first 20 Fibonacci numbers using loops. 8. Create a semi-log plot of the Fibonacci series.

Uploaded by

Ali Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views

Assignment Problems: T e T H X X X F

This document contains 8 questions asking the student to: 1. Plot various functions using MATLAB and label the axes and title. 2. Plot multiple functions on the same axes with a title and legend. 3. Plot x versus y for parametric functions, labeling the axes and titling the plot. 4. Animate the parametric plots using the comet command. 5. Create a subplot with sine and cosine plots from -20 to 20. 6. Plot a 3D surface plot. 7. Write a program to print the first 20 Fibonacci numbers using loops. 8. Create a semi-log plot of the Fibonacci series.

Uploaded by

Ali Ahmad
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

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 ) = e 0.1t sin ( 2t ), [0,24 ] 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 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 subplot, display the function y ( x ) = Sin( x ) from x = 20 to x = +20 , and in the

( ) second subplot, display the function y ( x ) = cos 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 Fibonacci series is represented as follows: 0, 1, 1, 2, 3, 5, 8, 13, It is defined for all is as xi = xi-1 + xi-2. Write a program using loops to print the first 20 numbers in the Fibonacci series. 8. Generate a semi-logarithmic plot of the Fibonacci series you generated in question 7. You will want to make the y-axis logarithmic. Hint : You may use SEMILOGY.

You might also like