A simple function to merge two structures as long as they are the same size.
[test1(1:2,1:2).A] = deal(1,2,3,4)
[test2(1:2,1:2).B] = deal(5,6,7,8)
out = fJoinStructures(test1, test2)
2x2 struct array with fields:
Grant Lohsen (2020). Merge Structures (https://www.mathworks.com/matlabcentral/fileexchange/31809-merge-structures), MATLAB Central File Exchange. Retrieved .
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!