Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Fitting a curve to your data in MATLAB can show trends and estimate values not included in the data set. In this problem, you will

Fitting a curve to your data in MATLAB can show trends and estimate values not included in the data set. In this problem, you will use MATLABs built-in polynomial curve fitting functions to determine the best equation for the data given in the Excel file swingData.xlsx.
a) Read the Excel file swingData.xlsx into the Workspace and call it swingData (this must be done using a function in your m-file).
i) The first column of swingData is the time in seconds incremented from 0 to 4. Save this column as a separate variable called Time.
ii) The second column of swingData is the swing height at different time increments. Save this column as a separate variable called yPosition.
b) Using the polyfit() function in MATLAB, find the best-fit coefficients for the given data in swingData. Call the output of the polyfit function coeffs. Test different order polynomials in the polyfit function to find the best-fit curve for the data.
c) Create an equation using the coefficients in coeffs (this should be done by referencing the values from coeffs). Call this equation yEqn.
d) Calculate how well your equation fits the given data points using the sum of squared errors method. Call the output SSE_yEqn. Refer to your lecture slides if you dont remember.
i) Is the value high or low? What does that value tell you about your equation? Write your answer as a comment inside your m-file.
e) Using the polyval() function in MATLAB, find the swing height at 5.4 seconds if the swings motion were to follow your equation. Assign the output to Height.

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

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students explore these related Databases questions

Question

=+ Are they breakable for any reason?

Answered: 3 weeks ago