hi
i have X = [1 5 7 6 9 2 3 1 4 8 6 5]; and i want to do [1+5 5+7 7+6 6+9 ...] how can i do that?
thanks

 Réponse acceptée

Matt J
Matt J le 18 Déc 2018

0 votes

X(1:end-1)+X(2:end)

Plus de réponses (1)

Matt J
Matt J le 18 Déc 2018
Modifié(e) : Matt J le 18 Déc 2018

0 votes

conv(X,[1,1],'valid')

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by