如何计算矩阵的以2为底的对数? [英] How to calculate the base 2 log of a matrix?

查看:115
本文介绍了如何计算矩阵的以2为底的对数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发现的唯一计算矩阵而不是矩阵每个对数的对数的函数是scipy的

The only function that I found that calculates the log of the matrix, and not of each component of the matrix, was scipy's logm() function, but it finds the log with base e, I need the base 2 log.

推荐答案

您可以使用基数更改公式来转换对数的底数:

You can use the change-of-base formula to convert the base of the logarithm:

log2(x) = logm(x) / logm(2)

Mathematica StackExchange对此背后的数学进行了更深入的讨论:

Mathematica StackExchange has some more in depth discussion of the math behind this:

https://mathematica.stackexchange.com/a/92293

这篇关于如何计算矩阵的以2为底的对数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆