Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

Hey,I have this huge data file and what i would like to do is , use strfind to match the string and capture the data followed by this string(no problem).my problem is that i have same string twice..how can i write a code to take first match first?

조회 수: 1 (최근 30일)
**edge
1 2 2
4 5 6
*edge
-1 1 1 -8 9 10
*edge
2 8 9
3 5 6

답변 (1개)

Yogananda Jeppu
Yogananda Jeppu 2016년 10월 6일
A={'**edge'
'1 2 2'
'4 5 6'
'*edge'
'-1 1 1 -8 9 10'
'*edge'
'2 8 9'
'3 5 6'
}
a=strfind(A,'edge')
find(~cellfun(@isempty,a))
This seems to work.
  댓글 수: 1
kavitha sundu
kavitha sundu 2016년 10월 6일
Nah,i dont want to put this in some cell array. I want to do this directly from the text file and a if clause to take the first value first

이 질문은 마감되었습니다.

Community Treasure Hunt

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

Start Hunting!

Translated by