Effacer les filtres
Effacer les filtres

How to get row index of cell which contains certain matrix

1 vue (au cours des 30 derniers jours)
Hany Ferdinando
Hany Ferdinando le 19 Jan 2015
Commenté : Hany Ferdinando le 19 Jan 2015
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 1x12. I have another matrix called A (1x12 logical). I want to get which row in Data which contains A.
Thanks a lot
regards Hany

Réponse acceptée

Guillaume
Guillaume le 19 Jan 2015
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)));

Plus de réponses (0)

Catégories

En savoir plus sur Cell Arrays dans Help Center et File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by