Question: Create a variable named x and use the linspace function to assign it 5 5 values ranging from - 5 to 5 . Next, create

Create a variable named x and use the linspace function to assign it 55 values ranging from -5 to 5. Next,
create a variable named y and assign it the values of x times 0.2. Now create a variable named y2 and
assign it the values of a sine by passing x to the sin function. Use the function plot to plot x vs
y. Use the function hold on so that you may plot x vs y2 on top of this. Use the function title to create a
graph title called Simple Line and Sine. Next use the xlabel and ylabel functions to label the x and y
axis as Time (s) and Data respectively. Use the function legend to label y as line and y2 as sine. Finally
call hold off so that nothing else is plotted on top of these graphs.
Create a sinc wave. Do so by specifying an x vector ranging from -pi to pi (pi is a reserved keyword in
MATLAB of value pi) with 70 values, and then pass this vector to the sinc function. Now, amplify this sinc
wave so that it has a max value of 50. Hint: this is done by mathematically manipulating the values
produced by the sinc function. Plot the result, give it some title and some x and y labels. Separately plot
the result again using the stem function. Note which plot represents the continuous-time function and
which represents the discrete-time function.
Finally, create a vector named vectorA. Use linspace to assign it 11 values ranging from 2 to 3. Now create
another vector named vectorB. Then, assign it values using the following code vectorB=2:.1:3. Inspect the
actual values of these vectors by opening them (click on their names in the workspace). Are they the
same? Conceptually, how did the construction of these two vectors differ (what is the difference in the
parameters used to construct them)?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!