필터 지우기
필터 지우기

Derive base 10 logarithm from base 2 log output

조회 수: 11 (최근 30일)
Life is Wonderful
Life is Wonderful 2021년 11월 15일
댓글: Life is Wonderful 2021년 11월 15일
Hi
I am looking to calculate .
  • log10 with base2log as input.i.e. log10(log2())
  • log() with base2log as input i.e. log(log2())
I have only base2log function available for calculation and I don't have common log() and log10() available
Below is my code and I am looking for the right mathematical formula for conversion so that I can get equivalent log() and log10() using log2()
Thank you!!
input = 32;
b = log2(input);
constant = 2.30258509299405; % assuming log(10)
base10 = log(b) / (constant) % formula for conversion, I don't have log function available
base10 = 0.6990
output = log10(b)
output = 0.6990
nlog = log(input) % need conversion formula
nlog = 3.4657
nlog = log(32)/log(2.718281828)
nlog = 3.4657

채택된 답변

Chunru
Chunru 2021년 11월 15일
The formula is:
For any given base b, you need to compute a constant .

추가 답변 (0개)

카테고리

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

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by