Finding product product of elements in a vector

3 ビュー (過去 30 日間)
MG
MG 2015 年 11 月 28 日
回答済み: Image Analyst 2015 年 11 月 28 日
I am using a vector whose length I want to vary. So supposing the vector is x = [f(1), f(2), f(3), ..... f(n)]. How do I find the product of all these entries multiplied with each other? I don't want to use cumprod because it gives me a vector output, but I only want the scalar output where the final answer is a product of all the entries.

採用された回答

Image Analyst
Image Analyst 2015 年 11 月 28 日
Use the prod function
theProduct = prod(yourVector);

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGeometric Transformation and Image Registration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by