Update table from columns of another table
9 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Fabio
am 21 Dez. 2021
Kommentiert: Fabio
am 21 Dez. 2021
Hello everyone,
I have two tables, “Atab” and “Btab”, and I would like to update “Atab” by adding all the columns (variables) and their respective values that are in “Btab” but not in “Atab” (meaning columns “Trans” and “Det”).
See in attached “Atab”, “Btab” and the expected “Output” in jpeg files.
Thanks in advance
0 Kommentare
Akzeptierte Antwort
Walter Roberson
am 21 Dez. 2021
Avars = A.Properties.VariableNames;
Bvars = B.Properties.VariableNames;
BnotA = setdiff(Bvars, Avars);
Atab = [Atab, B(:,BnotA)];
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!