0001 function conformed = bml_annot_conform_to(template, annot)
0002
0003
0004
0005
0006
0007
0008
0009
0010 template_vars = template.Properties.VariableNames;
0011 annot_vars = annot.Properties.VariableNames;
0012
0013 missing_vars = setdiff(template_vars,annot_vars);
0014 for i=1:length(missing_vars)
0015 if iscellstr(template.(missing_vars{i}))
0016 annot.(missing_vars{i}) = repmat({''},height(annot),1);
0017 elseif iscell(template.(missing_vars{i}))
0018 annot.(missing_vars{i}) = repmat({nan},height(annot),1);
0019 else
0020 annot.(missing_vars{i}) = NaN(height(annot),1);
0021 end
0022 end
0023
0024 conformed = annot(:,template_vars);
0025
0026
0027
0028