Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

data help with matlab coding, data posted A B C 17 3.2 176.2 18 3.4 3.6 19 20 21 1918 200.8 213.2 3.8 4 208.6

image text in transcribed

data

image text in transcribed

help with matlab coding, data posted

image text in transcribed

A B C 17 3.2 176.2 18 3.4 3.6 19 20 21 1918 200.8 213.2 3.8 4 208.6 22 4.2 23 4.4 204 201.6 205 24 4.6 25 4.8 208.4 210.4 26 5 27 28 Problem 2 (10 pts) Fitting a curve to your data in MATLAB can show trends and estimate values not included in the data set. In this problem, we will use MATLAB's built-in polynomial curve fitting functions to fit a curve to a car's velocity data given in the Excel file 'Nascar_Race_Data.xlsx'. a) Read the Excel file 'Nascar_Race_Data.xlsx' into the Workspace and call the data set RaceData (this must be done using a function in your m-file). b) RaceData should be a 26x2 matrix. The first column is the time increment from 0 to 5 seconds. This should be saved as a separate variable called Time. The second column is the velocity of the car in mph. This should be saved as a separate variable called Velocity. c) Plot the velocity vs. the time using cyan circle markers with no line. d) Use polyfit and polyval functions to find the best-fit coefficients and fitted data points for the polynomial curve. Call the output of the polyfit function coeffs and the output of the polyval function y_fit. Test different order polynomials in the polyfit function to find the best fit curve for the data. 1/2. e) Plot y_fit vs. Time as a black line on the same plot as the original data (from Part c). f) Title the plot 'Racecar Velocity vs. Time'. Provide correct x-axis and y-axis labels (including correct units). Include a legend to distinguish the real data points from the fitted curve. 1 0 0 2 6.4 2 3 0.2 0.4 3 13 4 0.6 19.6 5 0.8 27.4 6 1 33.4 7 1.2 40 8 1.4 51.4 9 1.6 64.6 1.8 73.4 10 11 2 101.6 12 111.6 2.2 2.4 13 122.4 14 2.6 136.6 2.8 15 16 17 150.2 160.4 3 3.2 176.2 18 3.4 191.8 200.8 3.6 3.8 19 20 21 22 213.2 208.6 4 4.2 204 23 4.4 201.6 24 4.6 205 25 4.8 208.4 210.4 26 5 27

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

3 The distinction between microeconomics and macroeconomics.

Answered: 1 week ago

Question

2 The role of economic theory in economics.

Answered: 1 week ago