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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started