How to separate numbers and text from a string
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello,
i have string variable s = 'x 5.67 y 7.789';
i would like to read only numbers from the string.
requesting you to help me, how to separate numbers and text from the string.
Thanks & Regards Venkatapathi.P
댓글 수: 0
채택된 답변
Azzi Abdelmalek
2014년 1월 28일
편집: Azzi Abdelmalek
2014년 1월 28일
s = 'x 5.67 y 7.789'
out=str2double(regexp(s,'[\d.]+','match'))
댓글 수: 4
Bhupinder Saini
2018년 9월 5일
How do you alter this to return the characters only in the string?
i.e. x.h y g j
Nader Virk
2022년 2월 25일
For string s, I appreciate if someone could help how to get only the chracters? Thanks!
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Characters and Strings에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!