How to merge multiple structures into one structure or a table?
Show older comments
I have an existing structure 'result1' which has several fields (10 in number) which are structures too. Please check the image attached. Inside each of these fields, say 'result(1).values' there are 5 different values and non-uniform in length compared result(2).values and so on. To proceed with my work I need to merge all the structures in one of the fields (example values field in the structure result1) into one structure. Based on my level of understanding so far, the only option seems to be working seems to be the below command. However, I have hundreds of entries in the field to be merged and this command based method is definately not the smartest one to do. Could anyone please help me on this?
Merged = [result1(1).values,result1(2).values,result1(3).values,result1(4).values.......till the last value];
Please note I tried vertcat and that doesn't work as there multiple fields side sub structures.
Accepted Answer
More Answers (0)
Categories
Find more on Read, Write, and Modify Image in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!