function w = combinerm(u,varargin)

N = length(u);
if (N==1)
   N = length(varargin);
   tmpu = u; clear u;
   for i=1:N
      u{i} = tmpu;
   end
end
u
if nargin~=N+1
   error('I need as many untrained mappings as datasets.');
end
if (N<2)
   error('I want to combine at least 2 datasets.');
end

for i=1:N
   if ~isa(varargin{i},'dataset')
      error('Input %d should be a dataset.',i+1);
   end
   dim(i) = size(varargin{i},2);
end
alldim = sum(dim);
cdim = cumsum(dim);

w = featsel(alldim,1:dim(1))*u{1};
for i=2:N
   w = [w featsel(alldim,cdim(i-1)+(1:dim(i)))*u{i}];
end

