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!