logarithm of base other than e,10 and 2
Show older comments
how do i find logarithms having base other than e, 10 and 2.
Accepted Answer
More Answers (4)
Tsegts
on 4 Nov 2022
1 vote
1 Comment
Walter Roberson
on 4 Nov 2022
log(x)./log(3)
Chris Lucero
on 18 Apr 2020
Edited: Walter Roberson
on 18 Apr 2020
y = logb(magic(3),[1 2 3; 4 5 6; 7 8 9]);
1 Comment
Walter Roberson
on 18 Apr 2020
logb appears to refer to the File Exchange contribution https://www.mathworks.com/matlabcentral/fileexchange/14866-logb
Walter Roberson
on 18 Apr 2020
if you really get desparate:
arrayfun(@(V) feval(symengine,'log', B, V), A)
and you might want to double() the result. Note that for this to work, B must be a positive real number, whereas in Jame's solution of log(A)/log(B) then B does not need to be positive and does not need to be real-valued.
lina al noaimi
on 26 Feb 2022
0 votes
how do we convert from base 9 to base 12 in matlab
can you give me an example on it
1 Comment
Walter Roberson
on 26 Feb 2022
If you mean numeric base, in the same sense that Hexadecimal representation is base 16 number system, then use base2dec and dec2base.
If you mean log base then log12(x) = log9(x).^(9/12)
Categories
Find more on Simscape in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!