MATLAB: Comparision of cell elements


I have a cell like this:
cell={[1], [1 3 4], [],...
[], [3 4], [3 4], [3 4]}
I need to check if all elements of cell are equal or not.
I tried to use isequal, but it did not work.
How can I do that?

Best Answer

  • First and foremost don’t ever use cell as a variable name:
    isequal(yourcell{:}) % to check all the elements are equal to each other