How do I find the cell index ??

2 ビュー (過去 30 日間)
BHUKYA VENKATESH
BHUKYA VENKATESH 2022 年 6 月 27 日
コメント済み: BHUKYA VENKATESH 2022 年 6 月 27 日
I have a cell A{3}={[1 2 3 1]} {[5 6 7 5 0]} {[9 9 10 10 12]}
I want to find the the cell number that contain 12
that is A{3}
is there any code that finds the cell number??
I dont want to use any kind of loop here.
  3 件のコメント
BHUKYA VENKATESH
BHUKYA VENKATESH 2022 年 6 月 27 日
Thanks a lot.
BHUKYA VENKATESH
BHUKYA VENKATESH 2022 年 6 月 27 日
@Johan Pelloux-Prayer if I want to know the cell that contain 12, 1, 0 the? the ans is 3, 1,2

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

採用された回答

madrix
madrix 2022 年 6 月 27 日
A={[1 2 3 1],[5 6 7 5 0],[9 9 10 10 12]};
rem = cellfun(@(x) find(x == 12),A,'un',0);
idx = cellfun('isempty',rem);
find(~idx)
ans = 3

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by