I have a large vector of mostly zeros. I wish to divide the nonzero values by a value of N, and then add the divided value to the subsequent N-1 zero values. For example, if my vector is [….0 0 15 0 0 0 0 0 0 0….] and N=5, I want it to come out [….0 0 3 3 3 3 3 0 0 0….]. Thank-you for any tips!
MATLAB: Reducing nonzero values in vector and adding to subsequent zero values.
large vectorzero and nonzero values
Related Question
- How to delete zeros from a vector and place it again in that vector
- How to make a vector of zeros.
- How to find the mean and leave out the zeros
- What does “put a vector of ones in the 2nd row and a vector of ones in the 5th column” mean when I have a 10×10 matrix of zeros
- Finding a value and call the cell number or counting value on the same length of vectors.
- How to delete a certain number of rows in a vector
Best Answer