alternative options to prod

1 回表示 (過去 30 日間)
yonatan friedman
yonatan friedman 2019 年 12 月 14 日
コメント済み: yonatan friedman 2019 年 12 月 14 日
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

採用された回答

David Hill
David Hill 2019 年 12 月 14 日
output=ones(1,size(input,2));
for j=1:size(input,1)
output=input(j,:).*output;
end
  1 件のコメント
yonatan friedman
yonatan friedman 2019 年 12 月 14 日
thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by