finding all the other elements of a cell vector apart from zeros and empties
    조회 수: 4 (최근 30일)
  
       이전 댓글 표시
    
Dear all,
I want to find all the elements of a cell vector apart from zeros and empties Using the command
ismember(mm,setdiff(mm,'0' ))
I find all the elements apart from zeroes. But I want to find all the elements apart from zeroes AND empty cells. Note mm is a cell of dimension 1000 by 1
thanks
댓글 수: 1
  Thomas
      
 2012년 6월 4일
				can you post a small snipet of 'mm'. You say it is a cell but does it contain numbers and characters or just numbers..
채택된 답변
  Walter Roberson
      
      
 2012년 6월 4일
        mm( ~ cellfun( @(C) isempty(C) || (ischar(C) && strcmp(C, '0')), mm ) )
댓글 수: 4
  Walter Roberson
      
      
 2012년 6월 4일
				mm( ~ cellfun( @(C) isempty(C) || (ischar(C) && strcmp(C, '0')), mm ) & strcmp(mdata1(:,6),'b1') )
추가 답변 (0개)
참고 항목
카테고리
				Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
			
	Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


