Partial overwrite of data in a structure
이전 댓글 표시
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
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Structures에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!