finding cells with positive values in a cell array with empty cells, cells of positive integers, and cells of nans
    10 ビュー (過去 30 日間)
  
       古いコメントを表示
    
Dear Experts,
I would like to have the number and indices of cells with positive values in a cell array with cells of  positive integers, empty cells and nans.
The solutions I have found in this topic were not suitable.
Please, find the array attached.
Many thanks
LG
2 件のコメント
  dpb
      
      
 2021 年 3 月 1 日
				"solutions I have found in this topic were not suitable."
So, what were those?  No point in repeating the unwanted...
採用された回答
  dpb
      
      
 2021 年 3 月 1 日
        
      編集済み: dpb
      
      
 2021 年 3 月 1 日
  
      >> idx=cellfun(@(c)any(c>0),co_burst);
>> whos idx
  Name        Size              Bytes  Class      Attributes
  idx       856x340            291040  logical              
>> sum(idx,'all')
ans =
    72
>> 
or, the locations...
>> [r,c]=ind2sub(size(idx),find(idx));
>> [r(1:5) c(1:5)]
ans =
     5     1
     8     4
    31    13
    34    15
    55    25
>> 
0 件のコメント
その他の回答 (1 件)
参考
カテゴリ
				Help Center および File Exchange で Numeric Types についてさらに検索
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

