Say, I have a vector A=[2 4 6 8 10]. Is there any way I can create a vector of the average of consecutive elements of A, i.e. B=[3 5 7 9] without using a loop? Is there any matlab function to do that? Thanks in advance.
MATLAB: How to create a vector of the average of consecutive elements of another vector (without using a loop)
vector
Related Question
- How to create a second column of static values in a matrix
- Recreate vector
- How to simplify this code (remove for loop)
- Find first value below a minimum in a vectorized way
- More effcient way to generate unit vector multiples (no for loop)
- Index multiple elements in a vector using logical indexing
- How to find the index of any value in array (during for loop)
Best Answer