CatStruct2

Version 1.0.0.0 (2.47 KB) by Hassan
Concatenates Structures (fields each depth are merged)
314 Downloads
Updated 31 Dec 2011

View License

FinalStruct = CatStruct2(S1,S2) concatenates the structures S1 and S2 into one structure FinalStruct.

The fieldnames at each depth will be compared. In case the field name is found in both structures, the second occurence will overwrite the value of the first.

CatStruct2(S1,S2,'sorted') will sort the fieldnames alphabetically after merging the two structures.

Thanks to Jos van der Geest for providing the source code of CATSTRUCT on
http://www.mathworks.com/matlabcentral/fileexchange/7842-catstruct/content/catstruct.m

Cite As

Hassan (2024). CatStruct2 (https://www.mathworks.com/matlabcentral/fileexchange/34401-catstruct2), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
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.0.0.0