table

Methods

Method Reference: table.isequal

table: TF = isequal (A, B)
table: TF = isequal (A, B, …)

Test tables for equality.

TF = isequal (A, B) returns a logical scalar TF, which is true when the tables A and B are the same size, carry the same variable names, row names and metadata, and each pair of corresponding variables holds equal values, and false otherwise.

Variables are compared by value and not by class, exactly as isequal compares arrays elsewhere, so a table holding int8 ([1; 2]) equals one holding [1; 2]. The VariableTypes property, which only restates those classes, takes no part in the comparison. Every other property does: two tables differing only in Description, UserData, VariableUnits, VariableDescriptions or a custom property are not equal.

As with NaN, missing values are never equal, so a missing element anywhere in either table makes the result false; use isequaln to treat missing values as equal.

Further tables may be supplied, as in isequal (A, B, C, …), in which case TF is true only when all of them are equal to one another. Any argument that is not a table, a timetable included, makes the result false rather than raising an error.

Source Code: table