help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: log to arbitrary base


From: Doug Stewart
Subject: Re: log to arbitrary base
Date: Mon, 17 Aug 2015 20:48:19 -0400



On Mon, Aug 17, 2015 at 8:44 PM, Doug Stewart <address@hidden> wrote:


On Mon, Aug 17, 2015 at 6:23 PM, Eric Smith <address@hidden> wrote:
Hi

Both qalc (1) and Matlab have a log function like;
  log(125, 5) = 3

How do I find the log to base n with Octave?

Eric

_______________________________________________
Help-octave mailing list
address@hidden
https://lists.gnu.org/mailman/listinfo/help-octave


I think you are looking for

y= log(x)/log(n)

is that what you want?



here is a fun way to do it:
Create  a function called logxn
logxn=@(x,n) log(x)/log(n)
logxn =

@(x, n) log (x) / log (n)

now use it
>> logxn(125,5)
ans =  3.0000 
--
DASCertificate for 206392




--
DASCertificate for 206392


reply via email to

[Prev in Thread] Current Thread [Next in Thread]