MATLAB: How to get row index of cell which contains certain matrix

cell arraysfindlogical?

Hi all,
I put my measurement in N by 2 cell, called Data. The first column of this cell contains logical value with the same size, say 1×12. I have another matrix called A (1×12 logical). I want to get which row in Data which contains A.
Thanks a lot
regards Hany

Best Answer

Normally, you'd use ismember for this, but ismember is not defined for cell arrays (except cell arrays of strings), so use cellfun instead:
rows = find(cellfun(@(m) isequal(m, A), Data(:, 1)));