0001 function data_merged = dsMergeData(data1,data2)
0002
0003
0004 xp1 = dsAll2mdd(data1);
0005 xp2 = dsAll2mdd(data2);
0006
0007 xp_merged = merge(xp1,xp2);
0008 xp_merged.meta = xp1.meta;
0009
0010
0011 inds = true(1,ndims(xp_merged));
0012 inds(xp_merged.findaxis('populations')) = false;
0013 inds(xp_merged.findaxis('variables')) = false;
0014 xp_merged = xp_merged.sortAxis(find(inds));
0015
0016 if isfield(data1,'plot_files') && isfield(data2,'plot_files')
0017 data_merged = dsMdd2dsImage(xp_merged);
0018 elseif ~isfield(data1,'plot_files') && ~isfield(data2,'plot_files')
0019 data_merged = dsMdd2ds(xp_merged);
0020 else
0021 error('Unknown input types');
0022 end
0023
0024 end