function out=joinh(d1,d2)
%MAN_PAGE_BEGIN
%
%   @purpose	join horizontally two sets
%
%   @synopsys	joinh(d1,d2)
%   @description  
%
%   @see 
%
%MAN_PAGE_END

% By Antoine Duchateau. All Rights Reserved.
% Written: 15/11/99

%Compute the union set for labels
l1 = d1.labels;
l2 = d2.labels;

l = union(l1,l2);

for i=1:length(l1),
	l1inl(i) = find(l == l1(i));
end

for i=1:length(l2),
	l2inl(i) = find(l == l2(i));
end

data = zeros(length(l),size(d1,2)+size(d2,2))+nan;
data(l1inl,v)) = get_data(d1);
data(l2inl,d1.nv+(1:d2.nv)) = get_data(d2);

symbols(1,1:d1.nv) = d1.symbols;
symbols(1,d1.nv+(1:d2.nv)) = d2.symbols;

variables(1,1:d1.nv) = d1.variables;
variables(1,d1.nv+(1:d2.nv)) = d2.variables;

vartypes(1,1:d1.nv) = d1.vartypes;
vartypes(1,d1.nv+(1:d2.nv)) = d2.vartypes;

%remove double class
classes =

out = dataset(data,'symbols',symbols,'vartypes',vartypes,'labels',l,'variables',variables);
