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 日間)
kavitha sundu
kavitha sundu 2016 年 10 月 6 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
**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