Question: Function Name: physics Inputs: 1. (double) 1xM vector of time values 2. (double) 1xM vector of velocity values 3. (double) Degree that best fits velocity

 Function Name: physics Inputs: 1. (double) 1xM vector of time values

Function Name: physics Inputs: 1. (double) 1xM vector of time values 2. (double) 1xM vector of velocity values 3. (double) Degree that best fits velocity vs time data Outputs: None Plot Outputs: 1. A plot with subplots of Velocity vs. Time, Numerical Derivative vs. Time, and Analytical Derivative Vs. I ime Background: You are in PHYS 2211, and you are tired of plotting velocity and acceleration graphs by hand. Luckily, you just learned how to plot and to find derivatives numerically and analytically in MATLAB Function Description Write a function that first plots the velocity values vs. time and then estimates and plots the acceleration in two different ways. Your function should do the following 1. Create a 2x2 subplot 2. Plot the velocity vs time graph in black in the top left position 3. Approximate the acceleration data by finding the numerical derivative of the velocity. Plot the numerical acceleration vs time graph in red in the top right position 4. Now find the best-fit polynomial of the velocity data using the order given by the third input. Then, find a second approximation for the acceleration data by taking the analytical derivative of this polynomial and evaluating the derivative at the original time values. Plot your derivative in green in the bottom right position Notes: . The subplot in the bottom left position should not have a plot . Make the axes for all the subplots square . When plotting the numerical derivative, leave off the last time value, so the vector lengths are the same

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!