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
KSSV 2017-3-31
a={1000000000;-46924118041992187}
you can use a{1} and a{2}. Thus they are separated??
antennist
antennist 2017-3-31
@KSSV consider it a long number in a single cell.

请先登录,再进行评论。

采纳的回答

Jan
Jan 2017-3-31
If you mean
a = {'1000000000;-46,924118041992187;'}
use
str = strrep(a{1}, ',', '.');
n = sscanf(str, '%g;%g')

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Numeric Types 的更多信息

标签

尚未输入任何标签。

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by