% Antti Hannukainen
%
%
%
% Convert u = [ x1 ; x2 ;x3 ...]
% to format x = [ x1 x2 x3 x4 ....]
%
% function x = bvp_u2x(u,Dim,N)
%
% N   = number of points 
%


function x = bvp_u2x(u,N)

length(u);

Dim = length(u)/N;

I = [];

for i = 1:N
  I = [ I [(Dim*(i-1)+1):(Dim*i)]' ];
end


x = u(I);
