Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem 2 / MatlabGrader ( 1 6 points ) The natural logarithm of a number x > 1 = 2 can be approximated by the

Problem 2/ MatlabGrader (16 points)
The natural logarithm of a number x >1=2 can be approximated by the series
ln(x)
XN
n=1
(x 1)n
nxn : (1)
Write a Matlab function myLog that takes as input x and the number N and outputs as y the estimate of ln(x) using Eq.(1) and the
corresponding true relative error tre. For the true value of ln(x) use Matlabs build-in function log(x) here and in the following
problems. Code the function such that it can handle both scalar and column vector inputs for x, resulting in scalar, respective
column vector outputs for y and tre. If any of the values for x are x 1=2, i.e., Eq.1 is not applicable, call Matlabs error
function and output an appropriate error message. Do not print any results to screen or do any plotting within the function.

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_2

Step: 3

blur-text-image_3

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

Lab Manual For Database Development

Authors: Rachelle Reese

1st Custom Edition

1256741736, 978-1256741732

More Books

Students also viewed these Databases questions