Question: Please help by Using Matlab Create a variable named x and use the linspace function to assign it 55 values ranging from -5 to 5.

Please help by Using Matlab

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.

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!