comparision of cell elements
1 次查看(过去 30 天)
显示 更早的评论
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?
采纳的回答
madhan ravi
2019-5-29
编辑:madhan ravi
2019-5-29
First and foremost don’t ever use cell as a variable name:
isequal(yourcell{:}) % to check all the elements are equal to each other
1 个评论
Adam Danz
2019-5-29
+1;
And if you want to ignore NaN values
yourcell = {[nan 3 4], [nan 3 4], [nan 3 4]};
isequaln(yourcell{:})
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!