Problem 44416. Sum of adjacent elements in a vector
Solution Stats
Problem Comments
Solution Comments
-
1 Comment
why this code is not correct?
s = summ(v)
>> b=s
>> s(1)=[]
>> c=[[s],0]
>> s=[b+c]
>> s(end)=[]
-
2 Comments
sorry mate, this is unfair for those who actually came up with a compact solution
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 Solvers552
Suggested Problems
-
4190 Solvers
-
Find the two most distant points
2092 Solvers
-
Project Euler: Problem 5, Smallest multiple
854 Solvers
-
2498 Solvers
-
Given a square and a circle, please decide whether the square covers more area.
540 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!