MATLAB: Find equal rows between cell array and matrix into for loop

cell arraysequalforloopMATLABmatrixrows

Hi everybody,
i have a matrix (A) and a cell array (B) as follow:
A
-0.11 7.17 3.66
-0.09 3.45 1.55
-0.21 2.17 9.87
-0.14 4.88 6.66
B{1,1} B{1,2}
-0.09 3.45 1.55 -0.14 4.88 6.66
I need to detect the number of row of A equal to B{1,1} and B{1,2}. In this exemple i need to create a matrix or a cell array C as follow:
C
2
4
Thank you very much!
Riccardo

Best Answer

Try this:
A=[-0.11 7.17 3.66
-0.09 3.45 1.55
-0.21 2.17 9.87
-0.14 4.88 6.66]
B{1,1} = [-0.09 3.45 1.55]
B{1,2} = [-0.14 4.88 6.66]
C = find(ismember(A,cat(1,B{:}),'row'))