Thursday 15 August 2013

arrays - Matlab: Using Accumarray -


If I have a column of the date and a similar column of volume data, then this way:

  31,3 31,2 31,1 31,5 07,2 07,3 07,4 07,2 07,3 07,5 07,3 07,1 07,1 07,2 07,3 30 , 5 06.4   

For each date, I want to add data to the right hand column. If I submit it like this:

  orgSumVinDay = deposit (day IDX, VV); K = orgSumVinDay == 0; SumVininDay = orgSumVinDay; SumVinDay (k) = []   

This works; I see:

  11 29 5 4   

Which is correct on 31st, there was 3 + 2 + 1 + 5 = 11 , etc.

However, I want to get a column showing the cumulative additional display every day, so that it looks:

  3 5 6 11 2 9 11 14 1922 23 24 26 2 5 5 5 5 5 5 5 5 6 7 8 9 10 12 12 Thank you!   

can not be checked right now but I believe that you can save it to ..., [], @ cassam) . The final parameter will replace the cumsum default function with sum .

No comments:

Post a Comment