필터 지우기
필터 지우기

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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by