Question: help with coding Problem 2 (10 pts) The number of data points you have can affect the accuracy of your plot in MATLAB. In this

 help with coding Problem 2 (10 pts) The number of data

help with coding

Problem 2 (10 pts) The number of data points you have can affect the accuracy of your plot in MATLAB. In this problem, we will be plotting a quadratic function and a cosine curve with varying data points. a) Create 4 'X' arrays using colon notation: i. Create X1, an array that goes from -15 to 15 by increments of 5 Create X2, an array that goes from -15 to 15 by increments of 0.1 Create X3, an array that goes from -21 to 2t by increments of /2 Create X4, an array that goes from -21 to 2nt by increments of 0.1 ii. iii. iv. ii. ii. b) Create the quadratic equation 'Y = x2 + 3x 7' i. Create the variable Y1 based off the equation above, using the variable X1 as X Create the variable Y2 based off the equation above, using the variable X2 as X c) Plot Y1 and Y2 on the same plot vs. their respective 'X' arrays. Label the x-axis 'X', the y-axis 'Y', and title the figure 'Quadratic Function'. Create a legend and name the lines 'Quadl' and 'Quad2', respectively. i. Plot the quadratic function Y1 as a red dotted line Plot the quadratic function Y2 as a blue dashed line d) Create the cosine of the arrays X3 and X4 and save them as variables Y3 and Y4. e) Create a new figure and plot Y3 and Y4 on the same plot vs. their respective 'X' arrays. Label the x-axis 'X', the y-axis 'Y', and title the figure 'Cosine Function'. Create a legend and name the lines 'Cos3' and 'Cos4', respectively. i. Plot the cosine function Y3 as a black solid line ii. Plot the cosine function Y4 as a magenta dash-dotted line f) Explain (as a comment in your code) how the increments of the 'X' arrays affect the clarity and representation of the data being plotted

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!