Filter löschen
Filter löschen

element multiplication- question on multiplying row elements

5 Ansichten (letzte 30 Tage)
Mike
Mike am 4 Nov. 2013
Kommentiert: Mike am 4 Nov. 2013
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] ?

Akzeptierte Antwort

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

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by