%--------------------------------------------------
% Split:
% Takes a vector and fragments it into smaller 
% vectors each of length L
%--------------------------------------------------
function s = split(v,L)

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

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