0001 function outtree = ensemble_datastruct2tree(dataStruct,params)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
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