MATLAB 帮助中心
非负实数数组的自然对数
Y = reallog(X)
Y = reallog(X) 返回数组 X 中每个元素的自然对数。数组 X 只能包含非负实数。Y 的大小与 X 的大小相同。
Y
X
如果 X 是表或时间表,则 Y 是表或时间表。 (自 R2023a 起)
全部折叠
创建一个 4×4 矩阵并计算每个元素的自然对数。
X = magic(4)
X = 4×4 16 2 3 13 5 11 10 8 9 7 6 12 4 14 15 1
Y = 4×4 2.7726 0.6931 1.0986 2.5649 1.6094 2.3979 2.3026 2.0794 2.1972 1.9459 1.7918 2.4849 1.3863 2.6391 2.7081 0
输入,指定为标量、向量、矩阵、多维数组、表或时间表。X 中的值必须是非负实数。
数据类型: single | double | table | timetable
single
double
table
timetable
全部展开
reallog 函数完全支持 tall 数组。有关详细信息,请参阅 tall 数组。
reallog
backgroundPool
ThreadPool
reallog 函数完全支持基于线程的环境。有关详细信息,请参阅在基于线程的环境中运行 MATLAB 函数。
reallog 函数完全支持 GPU 数组。要在 GPU 上运行该函数,请将输入数据指定为 gpuArray (Parallel Computing Toolbox)。有关详细信息,请参阅在 GPU 上运行 MATLAB 函数 (Parallel Computing Toolbox)。
gpuArray
reallog 函数完全支持分布式数组。有关详细信息,请参阅使用分布式数组运行 MATLAB 函数 (Parallel Computing Toolbox)。
reallog 函数可以对表或时间表中的所有变量执行计算,而无需通过索引访问这些变量。所有变量都必须具有支持计算的数据类型。有关详细信息,请参阅Direct Calculations on Tables and Timetables。
log | realpow | realsqrt
log
realpow
realsqrt
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处