フィルターのクリア

any faster/straightforward way to find the location of empty cell in a cell array

2 ビュー (過去 30 日間)
Yu Li
Yu Li 2018 年 11 月 26 日
編集済み: madhan ravi 2018 年 11 月 26 日
Hi:
I have a cell array called 'tmp', it is either '1' or 'empty' inside. I want to find the location where '1' is in the 'tmp', what I did is use 'for-loop' to read inside one-by-one. is there any more straightforward way to do this?
Thanks!
Yu

採用された回答

madhan ravi
madhan ravi 2018 年 11 月 26 日
編集済み: madhan ravi 2018 年 11 月 26 日
index=find(cellfun(@isempty,tmp(:))) %returns index
command window:
index =
1
2
3
4
10
11
>>
  4 件のコメント
Yu Li
Yu Li 2018 年 11 月 26 日
thank you.
madhan ravi
madhan ravi 2018 年 11 月 26 日
編集済み: madhan ravi 2018 年 11 月 26 日
Anytime :)

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by