Partial overwrite of data in a structure
Show older comments
Is it possible to partially overwrite a structure? Let say I have two structures:
a.a=1;a.b=2;a.c=3;
and
b.a=11; b.b=12;
if I write a=b
, then I will have two exactly the same "b" structures. Instead I would like to end up with
a.a=11;a.b=12; a.c=3;
structure. So if there is such a member in the second structure it should be overwritten in the first, if there is no such a member in the second structure it should be untouched in the first. And it should work in the nested structures as well.
So is there any command or a short and fast solution? I am in a development of an evaluation of measurements, and when I am restructuring the data it always a hassle to put every data holder variable to a proper place. Once I am ready there will be no problem.
Thanks if you answer.
Csaba
Accepted Answer
More Answers (0)
Categories
Find more on Structures 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!