Extract number from cell with decimal

조회 수: 1 (최근 30일)
Cristian Martin
Cristian Martin 2022년 6월 8일
댓글: Cristian Martin 2022년 6월 8일
Hi,
Is there a way to extract from a cell with a number with two decimals, separatetly the value before . and separate the decimals?
number1 = a{:,12}; %here extract the full number 44.10 and I want number 1 = 44 and number2 = 10

채택된 답변

Dyuman Joshi
Dyuman Joshi 2022년 6월 8일
y={44.10};
befdec=floor(y{1})
befdec = 44
aftdec=rem(y{1},1)
aftdec = 0.1000

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

제품


릴리스

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by