alternative options to prod

1 vue (au cours des 30 derniers jours)
yonatan friedman
yonatan friedman le 14 Déc 2019
Commenté : yonatan friedman le 14 Déc 2019
input = [8 10 9 9 1
8 3 2 4 4
10 4 6 2 7
7 1 6 4 1]
output is = [4480 120 648 288 28]
and I can not use prod

Réponse acceptée

David Hill
David Hill le 14 Déc 2019
output=ones(1,size(input,2));
for j=1:size(input,1)
output=input(j,:).*output;
end
  1 commentaire
yonatan friedman
yonatan friedman le 14 Déc 2019
thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by