Find differences between 2 tables
70 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Dion Theunissen
am 26 Aug. 2022
Kommentiert: Adam Danz
am 13 Jan. 2026 um 15:07
I have to tables, an old one and a new one.
Is there a function or a way to check what the differences are between 2 tables based on checking rows?

So in this example, my output needs to be row 2 cause the other rows are identical.
0 Kommentare
Akzeptierte Antwort
Cris LaPierre
am 26 Aug. 2022
If A and B are tables or timetables, then setdiff returns the rows from A that are not in B.
1 Kommentar
Weitere Antworten (2)
Voss
am 26 Aug. 2022
If your tables are the same size and both contain all numeric data, then this would work:
% create some tables:
t1 = table([1;2;3],[4;5;6],[7;8;9])
t2 = table([1;2;3],[4;15;6],[7;8;9])
% find rows that are different:
row_different = find(~all(t1{:,:} == t2{:,:},2))
0 Kommentare
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!