필터 지우기
필터 지우기

deleting the entire line starting from 0,0,0 from a huge text file

조회 수: 1 (최근 30일)
pankti Patel
pankti Patel 2019년 1월 31일
댓글: pankti Patel 2019년 2월 6일
I have collected a huge data set and want to clear that dataset.
it is something like this-
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
0 0 0 0 1 0
-0 0 0 0 1 0
-0 0 0 0 1 0
18.2375 202.634 544.567 0 1 0
19.0986 202.448 544.067 0 1 0
19.9764 202.448 544.067 0 1 0
20.8398 202.308 543.692 0 1 0
21.6971 202.122 543.192 0 1 0
22.5579 201.983 542.817 0 1 0
23.4337 201.983 542.817 0 1 0 ........
i only want to keep the points and want to delete each line starting from 0,0,0 or -0,0,0
Can anyone help please?

답변 (1개)

Luna
Luna 2019년 1월 31일
Try this:
A(all((A(:,[1:3]) == [0 0 0])')',:) = [];
Where A is the Nx6 double array from your text file.

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by