Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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

Step: 3

blur-text-image

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

Database Principles Programming And Performance

Authors: Patrick O'Neil

1st Edition

1558603921, 978-1558603929

More Books

Students also viewed these Databases questions