필터 지우기
필터 지우기

How to delete rows from a CELL with certain values?

조회 수: 3 (최근 30일)
Akhil  Reddy
Akhil Reddy 2016년 6월 9일
댓글: Jos (10584) 2016년 6월 9일
It has thousands of rows and I want to remove any row with 0 or 99 or 999 in the row 12 and 13

채택된 답변

Jos (10584)
Jos (10584) 2016년 6월 9일
Similar question, similar answer ...
You should be able to modify the code from that one!
If you do not understand it, just ask for some more explanation...
  댓글 수: 2
Akhil  Reddy
Akhil Reddy 2016년 6월 9일
what if i need to check values from particular column?
Jos (10584)
Jos (10584) 2016년 6월 9일
Fair enough. You can select the columns first:
A_selected = A(:, [ 12 13]) ;
tf = ~any(cellfun(@(x) isequal(x,0) || isequal(x,99),A_selected, 'un',1),2) ;
B = A(tf,:) ;

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by