function [xout,yout,zout,aout]=subsamp(n,m,x,y,z,a)
%function [xout,yout,zout,aout]=subsamp(n,m,x,y,z,a)
%       boxcars with n points, then
%       subsamples by m points the various arrays

ss=1: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

