フィルターのクリア

product in an array

2 ビュー (過去 30 日間)
PChoppala
PChoppala 2011 年 10 月 14 日
Hi all
Just a quick question, and will appreciate your help.
Suppose I have w=[a b c d e f] I want a new matrix that gives the product of every two consecutive elements. ie [axb, cxd, exf] and will be a 1x3 matrix
Another factor is the size of w is (mxN), and in the above case, m=2;N=3
So, I also assume length(w)/N might need to be used as well.
Looking for suggestions ASAP
cheers

採用された回答

Walter Roberson
Walter Roberson 2011 年 10 月 14 日
blkproc(w1,[size(w1,1) 2],@(x) prod(x(:) )

その他の回答 (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