Linear Interpolation code and plotting

조회 수: 6 (최근 30일)
GiselleG
GiselleG 2021년 4월 20일
답변: Stephan 2021년 4월 20일
Hello everyone, I am relatively new to matlab and i got the interp1 down when i have a table infront of me to solve for a specific value. but when it comes to this question i am completely lost on how to begin: Estimate the natural logarithm of 2 using linear interpolation. First, perform the computation by interpolating between ln 1 = 0 to ln 6 = 1.791759. Then repeat the procedure, but use a smaller interval from ln 1 to ln 4 = 1.386294. The true value of ln 2 is 0.6931472. What script would be used to solve this?

답변 (1개)

Stephan
Stephan 2021년 4월 20일
interp1([1 6],[log(1) log(6)], 2)
ans = 0.3584

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by