function B=annavge(A)

% A is a matrix with data at a quarterly frequency. Translate into yearly.
 
rows=size(A,1);
cols=size(A,2);

B=zeros(rows/4+10,cols);

for i=1:cols
    for j=4:4:rows
        B(j/4,i)=(A(j-3,i)+A(j-2,i)+A(j-1,i)+A(j,i))/4;
    end
end
