Get number from a string
10 ビュー (過去 30 日間)
古いコメントを表示
How do I get -0.966 from the string B as a number
B = α -0.966 ° OK 4.000 -15.000 ° 23.000 ° Freiwinkel
I'm missing the minus when I do this:
out_all= regexp(B, '\w*\d', 'Match');
out_all = out_all{1,1};
Radius = append(out_all{1},'.',out_all{2});
0 件のコメント
採用された回答
Stephen23
2022 年 6 月 10 日
B = 'α -0.966 ° OK 4.000 -15.000 ° 23.000 ° Freiwinkel'
C = regexp(B,'[-+]?\d+\.?\d*', 'match')
V = str2double(C)
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Signal Processing Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!