Home > database > archived_scripts > ensemble_datastruct2tree_bak.m

ensemble_datastruct2tree_bak

PURPOSE ^

SYNOPSIS ^

function outtree = ensemble_datastruct2tree(dataStruct,params)

DESCRIPTION ^


 converts from an Ensemble data structure to a tree structure in
 the same format that mysql_extract_metadata uses.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function outtree = ensemble_datastruct2tree(dataStruct,params)
0002 %
0003 %
0004 % converts from an Ensemble data structure to a tree structure in
0005 % the same format that mysql_extract_metadata uses.
0006 %
0007 
0008 % 16 March, 2007 Stefan Tomic
0009 % 28 April, 2007 Petr Janata - changed tree to outtree, and added check to
0010 %                make sure outtree isn't empty prior to attempting the call
0011 %                to convert_structarray
0012 %
0013 
0014 outtree = [];
0015 
0016 fnames = dataStruct.vars;
0017 
0018 for ifld = 1:length(fnames)
0019   
0020   dataVals = dataStruct.data{ifld};
0021   
0022   if(iscell(dataVals) & isstruct(dataVals{1}))
0023     
0024     
0025     for idx = 1:length(dataVals)
0026 
0027       dataVals{idx} = ensemble_datastruct2tree(dataVals{idx});      
0028       
0029     end
0030     
0031     
0032   end
0033   
0034   outtree.(fnames{ifld}) = dataVals;
0035   
0036 end
0037 
0038 if ~isempty(outtree)
0039     outtree = convert_structarray(outtree);
0040 end
0041 
0042 
0043

Generated on Sun 24-Mar-2019 04:00:51 by m2html © 2003