Recursive Structure Merge

Merge a structure (array) to another structure (array) in a nested (recursive) way
214 Downloads
Updated 11 Jul 2014

View License

This function merges a from structure (array) to a to structure (array) in a recursive manner when values contain structures (arrays). At any level: 1) If two single structures are to be merged, the same fields in the to structure are overwritten by the fields in the from structure. Extra fields from the from structure are added to the to structure. 2) If one or both of the structures are arrays, they are concatenated in terms of their elements and merged in terms of their fields.

Cite As

Dongxi Zheng (2024). Recursive Structure Merge (https://www.mathworks.com/matlabcentral/fileexchange/47199-recursive-structure-merge), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2013a
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Structures in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.1.0.0

Correct a typo in the file description

1.0.0.0