I have 4 columns of data in an array. The first three columns are year, month, day. The 4th column is a z-score. I need to compute the average of the 4th column for as long as the date increases by one day. When there is more than a 1 day difference between the dates the average needs to stop so that the average is only of consecutively increasing dates. Then a new average will pick up for the next set of consecutively increasing dates. Here is the first few rows of my data. Column 1 (years) = (1950,1950,1950,1950,1951,1951,1958,1958,1958,1959), Column 2 (month) = (11,11,11,11,3,3,2,2,2,3), Column 3 (day) = (22,23,24,25,11,12,15,16,17,2), and Column 4 (zscore) = (-.7,-.5,-1.1,-1.3,-1.6,-.8,-.5,-1.4,1,.5).
MATLAB: Average of consecutively increasing numbers
arrayaverageconsecutive integersmoving averagerun length
Related Question
- Please help!!!! Write a function that returns the number of days between dates
- How to get the frequency of a column of values
- Last daily observation in a month (not lbusdate)
- Read mix data from .txt file
- Find the Monday preceding the third Friday of the month
- I’m getting this error(“Operands to the || and && operators must be convertible to logical scalar values”) for the below code, can anyone help me with this error
Best Answer