mttAppendFields.m 465 B

123456789101112
  1. function information = mttAppendFields(information,extra)
  2. if isstruct(information) & isstruct(extra)
  3. information_fields = fieldnames(information) ;
  4. extra_fields = fieldnames(extra) ;
  5. for i = 1:length(extra_fields)
  6. field_name = extra_fields{i} ;
  7. extra_field = getfield(extra,field_name) ;
  8. information = setfield(information,field_name,extra_field) ;
  9. end
  10. end