필터 지우기
필터 지우기

Erase row based on a specific condition in Matlab

조회 수: 3 (최근 30일)
Maria
Maria 2014년 8월 5일
답변: Sean de Wolski 2014년 8월 5일
I have a cell array with 10000 rows and 7 columns.
A={ 701 1999 53,7 701 407 31 18
702 1999 39,6 [] [] [] []
729 1999 48,6 729 2000 40 []
734 1999 70,6 [] [] [] []
745 1999 60,9 730 2000 13 [] }
I would like to erase the rows that have a blank entry in the 4th column. So I would get:
A={ 701 1999 53,7 701 407 31 18
729 1999 48,6 729 2000 40 []
745 1999 60,9 730 2000 13 [] }
Thank you

채택된 답변

Sean de Wolski
Sean de Wolski 2014년 8월 5일
idx = cellfun(@isempty,C(:,4));
A = A(~idx,:)
or
A(idx,:) = []

추가 답변 (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