Problem 44416. Sum of adjacent elements in a vector
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
bentzi grinfeld
on 29 Apr 2019
why this code is not correct?
s = summ(v)
>> b=s
>> s(1)=[]
>> c=[[s],0]
>> s=[b+c]
>> s(end)=[]
-
2 Comments
Shaul Salomon
on 3 Dec 2017
sorry mate, this is unfair for those who actually came up with a compact solution
Samuele Grillo
on 12 Dec 2017
No need to be sorry.
Personally I think the regexp should be always forbidden.
I used it (and I had never thought about it before) because it seems that everyone is using it.
Problem Recent Solvers562
Suggested Problems
-
Is my wife right? Now with even more wrong husband
1304 Solvers
-
Back to basics 8 - Matrix Diagonals
885 Solvers
-
578 Solvers
-
Deleting an element in a matrix
442 Solvers
-
241 Solvers
More from this Author25
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!