How to extract the string left and right to the matching alphabet
1 回表示 (過去 30 日間)
古いコメントを表示
Hi,
I have below cell array:
{'VA00K100E4TOO';'ZVA00K100E4TOO';'VZA00K100E6TO';'VB00K100E4TOO';'VP00K50E4T4O';'ZVG00K100E4TOO';'VF00K40E4T5O'}
I want to extract left and right side numerical of "E"
Desired Output:
100E4
100E4
100E6
100E4
50E4
100E4
40E4
0 件のコメント
採用された回答
David Fletcher
2018 年 4 月 5 日
strs={'VA00K100E4TOO';'ZVA00K100E4TOO';'VZA00K100E6TO';'VB00K100E4TOO';'VP00K50E4T4O';'ZVG00K100E4TOO';'VF00K40E4T5O'}
result=regexp(strs,'\d+E\d+','match')
This returns a cell array of matching substrings
Assumes: the marker will always be an uppercase E. Returns one or more successive digits before the 'E' and one or more successive digits after the E
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Data Acquisition Toolbox Supported Hardware についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!