subject

In(1 + x) can be approximated using the following Maclaurin series expansion: x2 In(1 + x) = %=1(–1)n-1 * = x - x2/2 + x3/3 - x4/4 for (12x>-1)
Use the pseudocode below to implement the expansion as a MATLAB function. Calculate the true percent relative error for each iteration. The loop should terminate when the true percent relative error of falls below 0.0001. The true value can be found using the MATLAB's log function and the approximation is found using the Taylor series expansion. The input to the function should be the value x. Test your code with x = 0.25.
FUNCTION my_In(x)
tpre = 100
approx = 0
true_value = In(1+x)
n = 1
DO
new_term = (–1)n-1 X
approx = approx + new_term
tore-[true value – approx * 100 tpre = true value
n= n +1
IF tpre < 0.0001 OR n > 1000
EXIT
ENDIF
END
DO
Display approx
Display tpre
END my_In
Hint 1 - Don't use 'EXIT' to break out of your loop in MATLAB (this will exit MATLAB).

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 10:00
How do i delete my account on this because i didn't read this agreements and also i put age at xd
Answers: 1
question
Computers and Technology, 23.06.2019 10:20
Suppose there is a relation r(a, b, c) with a b+-tree index with search keys (a, b).1. what is the worst-case cost of finding records satisfying 10 < a < 50 using this index, in terms of the number of records n1, retrieved and the height h of the tree? 2. what is the worst-case cost of finding records satisfying 10 < a < 50 and 5 < b < 10 using this index, in terms of the number of records n2 that satisfy this selection, as well as n1 and h defined above? 3. under what conditions on n1 and n2, would the index be an efficient way of finding records satisfying the condition from part (2)?
Answers: 1
question
Computers and Technology, 24.06.2019 00:30
Use the keyword strategy to remember the meaning of the following word. the meaning for the word has been provided. write your keyword and describe the picture you would create in your mind. obfuscate: to make something so confusing that it is difficult to understand.
Answers: 2
You know the right answer?
In(1 + x) can be approximated using the following Maclaurin series expansion: x2 In(1 + x) = %=1(–1...
Questions
Questions on the website: 13722361