Estimate the common logarithm of 10 using linear interpolation.

Interpolate between log 8 = 0.9030900 and log 12 = 1.0791812.
I just learned using Matlab and suddenly got this question to do in Matlab. Can someone help me? Your help is really needed and very appreciated.

 채택된 답변

Oleg Komarov
Oleg Komarov 2012년 4월 6일
step = 0.1;
log10(8:step:12)

댓글 수: 3

Thanks for the idea :) i think i can solve it like this
t = 8:4:12;
p = [0.9030900 1.0791812];
interp1(t,p,10)
Be aware it's linear interpolation:
p(1) + diff(p)/2 % midpoint
gives the same result as your example above.
Uhm, happens I haven't seen you wanted linear interpolation.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Interpolation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by