What is the difference between a^3 and a.^3 if a is a matrix?

11 vues (au cours des 30 derniers jours)
Eduardo Gallegos
Eduardo Gallegos le 29 Oct 2022
Modifié(e) : James Tursa le 29 Oct 2022
C = magic(3)
D = C.^3;
D_max = max(D(:));
E = C^3

Réponse acceptée

James Tursa
James Tursa le 29 Oct 2022
Modifié(e) : James Tursa le 29 Oct 2022
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.

Plus de réponses (0)

Produits


Version

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by