Skip to content

mergeStruct

miscellaneous · scripts/miscellaneous/mergeStruct.m

: S = mergeStruct (S1, S2)

Merge two structures with non-overlapping field names.

The result has every field of S1 followed by every field of S2, in that order. S1 and S2 must be structures of the same size. If any field name appears in both inputs, an error is raised. Empty structures are allowed and contribute no fields.