function [xout,yout,zout,aout]=subsamp2(n,m,x,y,z,a)
%function [xout,yout,zout,aout]=subsamp2(n,m,x,y,z,a)
%         modification for matrices rather than vectors
%       boxcars with n points, then
%       subsamples by m points the various arrays

ss=2:m:length(x);
xout=boxfilt(x,n);
xout=xout(ss,:);
if nargin>3 
    yout=boxfilt(y,n);
    yout=yout(ss,:);
    if nargin>4
        zout=boxfilt(z,n);
        zout=zout(ss,:);
        if nargin>5
            aout=boxfilt(a,n);
            aout=aout(ss,:);
        end
    end
end

