You can compare the content of two cell arrays element-wise using the isequal()
function. However, if the cell arrays have different number of elements, they are not considered equal. In your case, as a
and b
have different contents, and different number of elements, you can use the setxor()
function to return the exclusive set of elements between a
and b
.
Here is an example code:
main.m69 chars5 lines
In this case, the setxor()
function results in a cell array that contains the unique elements present in a
and b
only, which are 6 and 5.
gistlibby LogSnag