Question
Using Matlab Natural log of 2 can be estimated through alternating harmonic series defined as: Write an m-file in which a for loop is used
Using Matlab
Natural log of 2 can be estimated through alternating harmonic series defined as:
Write an m-file in which a for loop is used to iterate over k (k=1:100) and to calculate the alternating harmonic series value for each k, and assign it to L(k,1). L(k,2) should be assigned as log(2) in each iteration.
See at what k the alternating harmonic series value (column 1 of L) is approaching log(2) (column 2 of L). Also plot the first column of L with a black solid line, and use hold on to plot the second column of L with a blue line in the same figure. See how the alternating harmonic series value merges to log(2) value. (10 points)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started