how can I select rows data from imported file
이전 댓글 표시
I have the following data from text file( Large data). I imported the file to matlab,
Small sample example of the data:
CATE VarName2 VarName3 VarName4 SATE
MODEL 2019 56 0 GPS
MODEL 2019 56 0 GPS
MODEL 2019 56 0 GPS
MEAS 2019 56 7650 GLO
M EAS 2019 56 7650 GPS
MEAS 2019 56 7650 GPS
MODEL 2019 56 0 GPS
MODEL 2019 56 0 GPS
MEAS 2019 56 7650 GPS
for example: from column (CATE) I want to choose the rows of MODEL only with out MEAS?
Also from column (SATE), if I want to choose all rows who has GPS only How I can do it?
The number of columns of 'MODEL row' are more than the number of columns in 'MEAS'.
답변 (1개)
KSSV
2019년 6월 27일
T = readtable(myfile) ;
idx = contains(T.CATE,'MODEL') ; % also have a look on strcmp
T(idx,:)
댓글 수: 3
Eman Saleem
2019년 6월 27일
KSSV
2019년 6월 27일
Attach your data. This can be resolved using options in readtable.
Sura Raya
2019년 6월 27일
i have same error, since we use (.out) not text or excel and columns dont have id ( CATE VarName2 VarName3 VarName4 SATE ) unless we import it in matlab, and readtable doesn't accept this type of files.
카테고리
도움말 센터 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!