How do I extract a substring in a cell array of strings?

조회 수: 14 (최근 30일)
Abdullah Hamidi
Abdullah Hamidi 2019년 3월 4일
댓글: Abdullah Hamidi 2019년 3월 4일
I have loaded up a catalog of satellite and space debris entries on MATLAB and I am trying to extract everything that is debris.
As you can see in the attachment (column 4), I am trying to run a for loop to look for strings that contain the word 'deb' (and other corresponding fields) and save them separately. But I am just not getting anywhere. Any help would be hugely appreciated.

채택된 답변

KSSV
KSSV 2019년 3월 4일
[num,txt,raw] = xlsread(myfile) ;
C4 = txt(:,4) ;
idx = contains(C4,'DEB')
Note that for better help, you should attach your file not an image snippet.
  댓글 수: 5
KSSV
KSSV 2019년 3월 4일
Ohhh....simple:
[num,txt,raw] = xlsread(myfile) ;
C4 = txt(:,4) ;
idx = contains(C4,'DEB')
iwant = txt(idx,:)
Abdullah Hamidi
Abdullah Hamidi 2019년 3월 4일
Perfect!!!
You're a life saver!

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by