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

1 回表示 (過去 30 日間)
Roger
Roger 2014 年 9 月 15 日
編集済み: Image Analyst 2014 年 9 月 15 日
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'.

採用された回答

Image Analyst
Image Analyst 2014 年 9 月 15 日
Scrap all that and just use ismember() instead.
  2 件のコメント
Roger
Roger 2014 年 9 月 15 日
globidx = find(ismember(cgroup,Qzonenum{i})==1); thanks
Image Analyst
Image Analyst 2014 年 9 月 15 日
編集済み: Image Analyst 2014 年 9 月 15 日
You should be able to drop the ==1 part.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeOptimization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by