フィルターのクリア

Read set framents of string.

3 ビュー (過去 30 日間)
Jonasz
Jonasz 2013 年 8 月 14 日
I have a lot of strings and I want only to read part of them and write to variable value of the string example :
abcdefghR12X478Y124
I need to read a coordinates of this file
so X - 478
and Y - 124
what is the best way to extract it from the file name and write to X variable and Y variable.

採用された回答

Evan
Evan 2013 年 8 月 14 日
編集済み: Evan 2013 年 8 月 14 日
>> s = 'abcdefghR12X478Y124';
>> X = str2double(regexp(s,'(?<=X)\d+','match'))
X =
478
>> Y = str2double(regexp(s,'(?<=Y)\d+','match'))
Y =
124
  2 件のコメント
Jonasz
Jonasz 2013 年 8 月 14 日
Thank You very much !
Evan
Evan 2013 年 8 月 14 日
No problem! :)

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by