element multiplication- question on multiplying row elements

9 次查看(过去 30 天)
if I have a m*n matrix, it is possible to transform it into a m*n-1 matrix where each m row consists of [n0*n1, n1*n2, n2* n3, ...n-1*n] ?

采纳的回答

Azzi Abdelmalek
Azzi Abdelmalek 2013-11-4
x(:,1:end-1).*x(:,2:end)
  1 个评论
Mike
Mike 2013-11-4
Thanks guys- I ended up creating 2 matrices and multiplying the elements together. But this is a lot more efficient. Thanks!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by