|
|
| File Information |
| Description |
FUNCTION Y = LOGB(X,B)
logb: Calculates the logarithm of x to user-specified base b.
USAGE: y = logb(x,b)
(A trivial but useful function for arbitrary-base log calculations.)
Arguments:
Y: the base 'b' logarithm of input x
B: The base of the logarithmic calculation (default, e). Note that if B is non-scalar, it must be the same size as X. In that case, the log transformation will be element-by-element.
Examples:
1) To calculate the base 5 logarithm of 3:
y = logb(3,5)
2) To calculate element-wise the log of a non-scalar input using different bases:
y = logb(magic(3),[1 2 3; 4 5 6; 7 8 9]);
See also: log, log10, log2 |
| MATLAB release |
MATLAB 7.4 (R2007a)
|
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
| Comments and Ratings (11) |
| 04 May 2007 |
Yvan Lengwiler
|
|
|
| 04 May 2007 |
Brett Shoelson
|
|
|
| 04 May 2007 |
Yvan Lengwiler
|
|
|
| 07 May 2007 |
John D'Errico
|
|
|
| 07 May 2007 |
Brett Shoelson
|
|
|
| 07 May 2007 |
John D'Errico
|
|
|
| 08 May 2007 |
Christophe Lauwerys
|
|
|
| 05 Jan 2008 |
Brett Shoelson
|
|
|
| 27 Mar 2008 |
Ubgunner Gunner
|
|
|
| 13 Jul 2009 |
Juliette Salexa
|
|
|
| 16 Aug 2011 |
Francesco Pozzi
|
|
|
| Updates |
| 04 May 2007 |
Yvan's comments make good sense. This might be faster and more accurate using log rather than log10, and ./ allows for a vector of bases. |
| 07 May 2007 |
Addresses some good-programming-practices suggestions made by John D'Errico. Better description, help, error checking. |
| 04 May 2010 |
added copyright |
| 21 Jun 2010 |
Updated M file and license text file copyright to The MathWorks, Inc. |
|
Contact us at files@mathworks.com