Home > functions > internal > dsMergeData.m

dsMergeData

PURPOSE ^

MERGEDATA - Merge two Dynasim structures created from different simulations

SYNOPSIS ^

function data_merged = dsMergeData(data1,data2)

DESCRIPTION ^

 MERGEDATA - Merge two Dynasim structures created from different simulations

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function data_merged = dsMergeData(data1,data2)
0002     % MERGEDATA - Merge two Dynasim structures created from different simulations
0003     
0004     xp1 = dsAll2mdd(data1);
0005     xp2 = dsAll2mdd(data2);
0006     
0007     xp_merged = merge(xp1,xp2);
0008     xp_merged.meta = xp1.meta; % Warning - need to make sure metadata merges properly; not yet implemented
0009     
0010     % Sort everything except populations and variables
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

Generated on Tue 12-Dec-2017 11:32:10 by m2html © 2005