Question: Some data points have been created in which the y values rise to a peak and then fall again. However, instead of fitting a quadratic

Some data points have been created in which the y values rise to a peak and then fall again. However, instead of fitting a quadratic curve through these points, it is desired to fit two straight lines through these points: one through all points from the beginning through the point with the largest y value, and another that starts with the point with the largest y value through the last point. Write a function fscurve that will receive as input arguments the x and y vectors, and will plot the original points as red stars (*) and the two lines (with default colors, line widths, etc.). The Figure below shows the Figure Window resulting from an example of calling the function.

>> y = [2 4.3 6.5 11.11 8.8 4.4 3.1];

>> x = 1:length(y);

>> fscurve(x,y)

Figure Two straight lines

Do not assume that you know anything about the data except that you may assume that they do rise to a peak and then fall again.

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!