Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

P3) We wish to write a program that can find the approximate derivative of a function specified through a function handle. (a) Write a MATLAB

image text in transcribed
P3) We wish to write a program that can find the approximate derivative of a function specified through a function handle. (a) Write a MATLAB function defined below: function [appDerv, exDerv, et]- myDervwithFuncHandle (func, x, h) %Function file: myDervWithFuncHandle.m Purpose : % Calculate approximate derivative using (f(x+h)-f(x))/h, exact % derivative f"(x) and true percentage relative error of a function % specified in func Record of revisions (Date I Programmer I Change): % Date | Name | Original program %inputs : % func- [fx, dfx-func-name (x) function handle defined as for calculating f (x) and x % x- (1x1) value of x where derivative needs to be calculated % h- (1x1) step size used in approximate derivative formula Outputs: % appDerv- % exDerv- % et approximate derivative calculated as exact derivative (f(x+h)-f(x))/h (1x1) (1x1) (1x1) true percentage relative error (b) Using function handles to myF1 and myt2 as inputs for myDervWithFuncHandle, calculate the approximate derivative, exact derivative and true percentage relative error of (x)-r'e and f(x)-7 sin(x)e-x-1 at x = 1 with h = 0.05

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

MySQL/PHP Database Applications

Authors: Brad Bulger, Jay Greenspan, David Wall

2nd Edition

0764549634, 9780764549632

More Books

Students also viewed these Databases questions

Question

What are database queries? How do they work

Answered: 1 week ago