Info
この質問は閉じられています。 編集または回答するには再度開いてください。
how do i input this in built in funtions
1 回表示 (過去 30 日間)
古いコメントを表示
multiply and count elements
0 件のコメント
回答 (2 件)
Star Strider
2015 年 2 月 9 日
I’m not certain what you want, so I’ll venture this:
x=[3,7,2,9,4];
product_x = prod(x)
elements_x = length(x)
elements_x = numel(x)
produces:
product_x =
1512
elements_x =
5
elements_x =
5
0 件のコメント
Image Analyst
2015 年 2 月 9 日
If m is your matrix:
theProduct = prod(m(:)); % Multiply all elements together.
theCount = numel(m); % Count the number of elements in the array.
0 件のコメント
この質問は閉じられています。
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!