Question
Practice with the commands polyfit and polyval. Write a function in MATLAB called MYCURVEFIT that determines the y value of a best fit polynomial equation
Practice with the commands polyfit and polyval. Write a function in MATLAB called MYCURVEFIT that determines the y value of a best fit polynomial equation based on a single input, an x value. Predict the y value by fitting a 3rd order polynominal y=f(x) to the data points shown below. The input will be a single x value in the range of 0 to 20. The output should be a single y value obtained by evaluating the best fit third order polynomial at x. X=0:0.5:20 Y=[14,16,18,22,28,35,50,68,90,117,154,200,248,309,378,455,550,654,770,900,1044,1200,1378,1560,... 1778,2004,2250,2500,2800,3100,3434,3786,4158,4555,4978,5424,5900,6401,6930,7474,8074] You need to copy and paste the data above into your function
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