PDA

查看完整版本 : 求助:向量分段求乘积


fifa2002qwe
2008-05-31, 23:47
有一个列向量,有100个元素,我 想分别求每各20个元素的乘积,例如分别求第1-20,20-40,40-60,60-80,80-100的乘积

fgabertb
2008-06-01, 15:59
a=1:100; %原本的資料
prod(reshape(a,20,[]))
:smile:

fifa2002qwe
2008-06-01, 22:02
thank you very much