필터 지우기
필터 지우기

Group string based on charachter

조회 수: 2 (최근 30일)
Raldi
Raldi 2011년 12월 7일
Hi all If i have a string lets say a='1/23s' is there a way to take 1 and 23s seperately on some other variables so i can then extract only the numbers from them.

채택된 답변

Chandra Kurniawan
Chandra Kurniawan 2011년 12월 7일
a='1/23s';
i = findstr(a,'/')
b = a(1:i-1)
c = a(i+1:end)

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2011년 12월 7일
str2double(regexp(a,'\d+','match'))
and
regexp(a,'/','split')

카테고리

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