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 is cells of numbers or string?
antennist
antennist 2017년 3월 31일
Numbers.
Jan
Jan 2017년 3월 31일
편집: Jan 2017년 3월 31일
What does
a = {1000000000;-46,924118041992187;}
mean exactly?
a = '{1000000000;-46,924118041992187;}'
a = {'1000000000;-46,924118041992187;'}
'a = {1000000000;-46,924118041992187;}'
KSSV
KSSV 2017년 3월 31일
편집: KSSV 2017년 3월 31일
a={1000000000;-46,924118041992187;}
didn't this throw a error? Comma is not allowed...
antennist
antennist 2017년 3월 31일
편집: antennist 2017년 3월 31일
Yes this is cell containing two double values. a = {1000000000;-46,924118041992187;}
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일

1 개 추천

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Numeric Types에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2017년 3월 31일

댓글:

2017년 3월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by