MATLAB: Remove strings

removestrings

Hello, i have a problem, how to do that in matlab. For example I have that string '=20E002:004F12', but i need to separate only four strings, and exactly these one '004F'. Is there any command, which remove 8 first strings, and two last strings. Thanks in advice.

Best Answer

yourString = '=20E002:004F12' subString = yourString(9:12)
thats assuming your 004F is always at the 9th to 12th position in your string.
You should use strfind to search for the string of interest to find the index and use that index to extract your sub string.