

function MA=moving_average(V,winSize) %winsize= lag for moving average
    MA=zeros(size(V));
    for n=1:size(V,2)
        MA(:,n)=mean(V(:,max(1,n-winSize):n),2);
    end
end

