%---------------------------------------------
% split.m
%---------------------------------------------
% Split a vector into N equal lengths. If the 
% vector is not of proper length, the remainder
% is discarded.
%---------------------------------------------
function s = split(v,N)

M = length(v);
L = floor(M/N);

s = zeros(N,L);
for i = 1:N
    for j = 1:L
        s(i,j) = v(L*(i-1)+j);
    end
end
