Effacer les filtres
Effacer les filtres

how to get the index of the same element in a cell

1 vue (au cours des 30 derniers jours)
Roger
Roger le 15 Sep 2014
Modifié(e) : Image Analyst le 15 Sep 2014
if true
Qzonenum=unique(cgroup);
for i = 1:length(Qzonenum)
globidx=find(cgroup==Qzonenum{i});
end
end
then error:Undefined function 'eq' for input arguments of type 'cell'.

Réponse acceptée

Image Analyst
Image Analyst le 15 Sep 2014
Scrap all that and just use ismember() instead.
  2 commentaires
Roger
Roger le 15 Sep 2014
globidx = find(ismember(cgroup,Qzonenum{i})==1); thanks
Image Analyst
Image Analyst le 15 Sep 2014
Modifié(e) : Image Analyst le 15 Sep 2014
You should be able to drop the ==1 part.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Optimization dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by