Seperting numbers in a cell
2 次查看(过去 30 天)
显示 更早的评论
Hello,
How can I sepererate numbers in a cell with respect to semi colon seperating them? E.g. number is given below
a={1000000000;-46,924118041992187;}
I have tried with this command but it sepererates number with semi colon and comma.
b=regexp(a,'\d+(\;)?(\d+)?','match')
.
7 个评论
KSSV
2017-3-31
a={1000000000;-46924118041992187}
you can use a{1} and a{2}. Thus they are separated??
采纳的回答
Jan
2017-3-31
If you mean
a = {'1000000000;-46,924118041992187;'}
use
str = strrep(a{1}, ',', '.');
n = sscanf(str, '%g;%g')
0 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Numeric Types 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!