Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This practice problem reviews 3 different concepts-using interp1 to interpolate, using diff to differentiate, and using cumtrapz to integrate Write a MATLAB function named my_int_and_diff

image text in transcribed

This practice problem reviews 3 different concepts-using interp1 to interpolate, using diff to differentiate, and using cumtrapz to integrate Write a MATLAB function named my_int_and_diff that accepts three inputs and has a single output The first input will be a a scalar time value, the second input a list of time values, and the third input a list of velocity values The output should be a structure with fields named tim, pos, vel, and acc The function should numerically integrate velocity to generate position data and it should numerically differentiate (using the forward difference method) velocity to generate acceleration data. After that, it should use interpolation (interp1) at the first input value to calculate the values for the output structure Example clc; t-1:0.1:5; my int_and diff(1.8,t,t.3) Should display this in the command window ans - tim: 1.8e00 pos: 2.380 vel: 5.8320 acc: 10.2700 Your code should work for any set of inputs. Do not include test cases, clear all, etc as part of your submission. This practice problem reviews 3 different concepts-using interp1 to interpolate, using diff to differentiate, and using cumtrapz to integrate Write a MATLAB function named my_int_and_diff that accepts three inputs and has a single output The first input will be a a scalar time value, the second input a list of time values, and the third input a list of velocity values The output should be a structure with fields named tim, pos, vel, and acc The function should numerically integrate velocity to generate position data and it should numerically differentiate (using the forward difference method) velocity to generate acceleration data. After that, it should use interpolation (interp1) at the first input value to calculate the values for the output structure Example clc; t-1:0.1:5; my int_and diff(1.8,t,t.3) Should display this in the command window ans - tim: 1.8e00 pos: 2.380 vel: 5.8320 acc: 10.2700 Your code should work for any set of inputs. Do not include test cases, clear all, etc as part of your submission

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

Harness The Power Of Big Data The IBM Big Data Platform

Authors: Paul Zikopoulos, David Corrigan James Giles Thomas Deutsch Krishnan Parasuraman Dirk DeRoos Paul Zikopoulos

1st Edition

0071808183, 9780071808187

More Books

Students also viewed these Databases questions