remove strings

1 次查看(过去 30 天)
Eggo Ogge
Eggo Ogge 2011-3-25
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.
  1 个评论
Jos (10584)
Jos (10584) 2011-3-25
FYI, you're confusing strings and characters: a string is a sequence of characters.

请先登录,再进行评论。

采纳的回答

Robert Cumming
Robert Cumming 2011-3-25
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.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Characters and Strings 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by