필터 지우기
필터 지우기

How to extract the string left and right to the matching alphabet

조회 수: 3 (최근 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

채택된 답변

David Fletcher
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개)

카테고리

Help CenterFile 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!

Translated by