how to read numbers in a string where white-space separated everthing
7 次查看(过去 30 天)
显示 更早的评论
how to read numbers in a string where white-space separated everything here an example for 2 numbers in a string tab separated: '3 9 8 . 6 1 9 5 0 0 1 3 0 3 1 3 . 2 1 2 7 6 0'
Thanks, Frank
2 个评论
采纳的回答
Matt Fig
2012-11-8
编辑:Matt Fig
2012-11-8
This is not possible without more information. Say you do this:
S=strrep('3 9 8 . 6 1 9 5 0 0 1 3 0 3 1 3 . 2 1 2 7 6 0',' ','')
% S='398.619500130313.212760'
Should the second number be 313.212760 or 130313.212760 or 3.212760 or any of the other several or so combinations? You need to provide more information to be able to decipher the numbers.
14 个评论
Matt Fig
2012-11-8
Glad to help! I am still curious as to how you ended up with char(0) instead of char(32), but I guess we may never know.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 String Parsing 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!