logb

Calculate the log of a number/matrix using a user-specified base.
3,6K descargas
Actualizado 1 sep 2016

Ver licencia

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

Citar como

Brett Shoelson (2024). logb (https://www.mathworks.com/matlabcentral/fileexchange/14866-logb), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2007a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Log Plots en Help Center y MATLAB Answers.
Agradecimientos

Inspiración para: Order of magnitude of number

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.2.0.1

Updated license

1.2.0.0

Updated M file and license text file copyright to The MathWorks, Inc.

1.1.0.0

added copyright

1.0.0.0

Addresses some good-programming-practices suggestions made by John D'Errico. Better description, help, error checking.