Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

logarithm with variable base eg. log9

626 views
Skip to first unread message

Alexander

unread,
Jul 14, 2008, 8:07:02 PM7/14/08
to
Hi all,

I have to include the "simple" term
m(i,j)= log9(m(i,j)) in my MATLAB code. Unfortunatelly I
cant find any function that calculates the logarithm with
base 9.

MATLAB supports log (base e), log10 and log2. But what's
about log9, log8, log7 and so on. I am sure there is a way
to calculate the logarithm with a variable base. But how?

Moreover the inverse function is possible. You can solve
y=9^x but not x=log9(y). That would be strannge?

I really hope somebody can help.

Thank you very much!!!!!

Regards,
Alex

Amir

unread,
Jul 14, 2008, 8:20:18 PM7/14/08
to
Hi. Remember that when you want to calculate log base N,
you can calculate it in terms of any log function you have
(log10, log2, log base e).

So y = logN(x) also = logM(x)/logM(N) where M is ANY log.

For example, y=log9(x) = log10(x)/log10(9).


"Alexander " <sal...@gmx.net> wrote in message <g5gpn6
$glg$1...@fred.mathworks.com>...

Roger Stafford

unread,
Jul 14, 2008, 8:29:13 PM7/14/08
to
"Alexander " <sal...@gmx.net> wrote in message <g5gpn6$glg
$1...@fred.mathworks.com>...
---------
It's not very hard to write log(x)/log(b) in place of log_base_b(x). Or if it
occurs very often, you can even write a two-argument function to do the
same thing.

Roger Stafford

Walter Roberson

unread,
Jul 15, 2008, 3:28:50 AM7/15/08
to
In article <g5gpn6$glg$1...@fred.mathworks.com>,
Alexander <sal...@gmx.net> wrote:

>Moreover the inverse function is possible. You can solve
>y=9^x but not x=log9(y). That would be strannge?

If you have the symbolic toolbox, you can solve('x=9^y','y');
--
"He wove a great web of knowledge, linking everything together,
and sat modestly at a switchboard at the center, eager to help."
-- Walter Kerr

Alexander

unread,
Jul 15, 2008, 7:24:02 AM7/15/08
to
Hi there,

Thanky you very much for the helpful answers. Problem is
now solved. Thanks :-)

0 new messages