0001 function tf = is_ensemble_datastruct(inStruct)
0002
0003
0004
0005
0006
0007 if(~isstruct(inStruct))
0008 tf = 0;
0009 return
0010 end
0011
0012 emptyStruct = ensemble_init_data_struct;
0013
0014 emptyFieldNames = fieldnames(emptyStruct);
0015 inFieldNames = fieldnames(inStruct);
0016
0017 if(length(emptyFieldNames) ~= length(inFieldNames))
0018 tf = 0;
0019 return
0020 end
0021
0022 for ifld = 1:length(emptyFieldNames)
0023
0024 if (~isfield(inStruct,emptyFieldNames{ifld}))
0025 tf = 0;
0026 return
0027 end
0028
0029 emptyFieldType = class(emptyStruct.(emptyFieldNames{ifld}));
0030 inFieldType = class(inStruct.(emptyFieldNames{ifld}));
0031
0032 if(~strcmp(emptyFieldType,inFieldType))
0033 tf = 0;
0034 return
0035 end
0036
0037
0038 end
0039
0040 tf = 1;
0041 return