MATLAB: How to count occurrences of a number in a column in relation to an other column occurrence

occurrences of a number

i need to count occurrences of a number in a column in relation to an other column occurrence so e.g
A=
4 2 1
2 2 1
1 1 2
1 1 7
1 2 1
i need the number of times column 2 has a 1 while column 3 has a 7 so [any,1,7] and column 1 has a 2 while column 3 has a 7 so [2,any,7] I've tried
sum(A(:,2:3)==[1,7])
but that just gets the number of 1 and the number 7
(the real mat that i have to do is large)

Best Answer

took some time but there a way
sum(A(:,2)==1 & A(:,3)==7)