function X=packvec(varargin)
% packvec - Pack coordinate values in separate arrays into one big array
%
% packvec :: {[K]->[[E]]} -> [[K,E]].
%
% There is also a variable argument list form:
%
% packvec :: [[E]], [[E]] -> [[2,E]].
% packvec :: [[E]], [[E]], [[E]] -> [[3,E]].
% etc..


if nargin==1 && iscell(varargin{1})
	Y=varargin{1};
else
	Y=varargin;
end
[Y{:}]=promote(Y{:});
Y=cellmap(@(y)reshape(y,[1 size(y)]),Y);
X=cat(1,Y{:});


