What is the difference between a^3 and a.^3 if a is a matrix?
4 次查看(过去 30 天)
显示 更早的评论
C = magic(3)
D = C.^3;
D_max = max(D(:));
E = C^3
0 个评论
采纳的回答
James Tursa
2022-10-29
编辑:James Tursa
2022-10-29
E = C^3 is a matrix power, equivalent to E = C*C*C, where these are all matrix multiplies.
D = C.^3 is element-wise power, where D(1,1) = C(1,1)*C(1,1)*C(1,1), etc.
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!