remove strings

4 ビュー (過去 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.
  1 件のコメント
Eggo Ogge
Eggo Ogge 2011 年 3 月 25 日
Thanks very much!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCharacters and Strings についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by