N 1) - Also Check The Script On The Function
N 1) - Also Check The Script On The Function
N 1) - Also Check The Script On The Function
EXERCISE # 3
MATLAB
DIFFERENTIATION AND INTEGRATION
1. Assume a function is defined on grid,
Where is
x the sampling interval and N is the total number of samples, or grid-points. The
f (x)
f (x)
sided approximation
Where 0 x 10 . Assume
x0
2
( N 1 ) . Also check the script on the function
10
= ( N 1 ) .
Compute both the numerical derivative and the difference between the numerical derivative and
the exact derivative. Make plots of the error.
2. If we want to evaluate the integral,
x
I ( x )= f ( x ' ) d x '
a
I ( x )= f ( k x ) x
k=0
Where
'
x =k x
and x=( N1 ) x .
f ( x )=exp (x )
on the interval