필터 지우기
필터 지우기

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 CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by