%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% Name: splitVector.m
% Author: J. Kristoffer Hultgren
%
% Description:
%
% Splits a vector into a matrix
%
% Input:  data  - Input vector
%         span  - Size of resulting matrix
%
% Output: -
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

function out = splitVector(data,span)

temp = zeros(span, span);
n = 1;
m = 1;
while n <= span
    temp(1:span, n) = data(m:((span - 1) + m));
    n = n + 1;
    m = m + span;
end
out = temp;