Partial overwrite of data in a structure
Afficher commentaires plus anciens
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
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Structures dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!