MATLAB: How to search about a matrix in a cell

cellcell array

Hello,
Suppose that I have the cell matrix A which contains the following elements:
A={
[0;0] [0;1]
[1;0] [0;0]
}
So I want to use a line of code that can count how many [0;0] are in each row ?
Regards,

Best Answer

it's always a good idea to give the result you expect for your example to avoid ambiguity.
A={
[0;0] [0;1]
[1;0] [0;0]
}
sum(cellfun(@(x) isequal(x, [0;0]), A), 2)
results in
ans =
1
1
count of [0;0] in each row.