function xc = do_proj( x, traj ) % DO_PROJ Performs a projection of a group of points [ num_samples, m ] = size( x ); % m should be three ! [ num_times, m ] = size( traj ); xc = zeros( [ num_times, num_samples * 2 ] ); for time = 1:num_times index = 1; for sample = 1:num_samples xc(time, index:(index + 1)) = project( x(sample,:)', traj(time,:) ); index = index + 2; end end