array element multiplication using arrayfun or bsxfun?

2 ビュー (過去 30 日間)
Chong Tao
Chong Tao 2013 年 10 月 30 日
コメント済み: Chong Tao 2013 年 10 月 30 日
how can I use arrayfun to do multiplication of array element by column, say I have a 300X10 array, I want to do simple math of the elements from column 2 to 9, to get: (1-A(:,2)).*(1-A(:,3))... .*(1-A(:,9))? thanks!

採用された回答

Azzi Abdelmalek
Azzi Abdelmalek 2013 年 10 月 30 日
編集済み: Azzi Abdelmalek 2013 年 10 月 30 日
A simple way
prod(1-A(:,2:9),2)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by