MATLAB: Mutiple observations for single date

cumsum dates

I have a matrix of dates and observations, but i have multiple of observations for a particular dates, how can I apply cumsum to the observations for these specific dates, the matrix is huge so I cannot do it individually any ideas.

Best Answer

An example of the data (so we can have idea how it's organised) would be helpful. In its absence, the only thing I could advise is to use accumarray, possibly with unique to build the indices of unique dates.
For example, (replacing dates with integers here for simplicity:)
dateobs = [1 5; 4 8; 9 10; 1 3; 2 7; 1 10; 9 1]; %first column is date, 2nd column is observation:
[uniquedates, ~, subs] = unique(dateobs(:, 1));
datecumobs = [uniquedates accumarray(subs, dateobs(:, 2))]