joining integer ans decimal part of number

조회 수: 2 (최근 30일)
shivam pranjale
shivam pranjale 2018년 8월 29일
답변: Star Strider 2018년 8월 29일
I have 2 numbers say 100 and 0.025 and I want to print them as 100.025, how this could be done?

답변 (1개)

Star Strider
Star Strider 2018년 8월 29일
The easiest way is to just add them:
n1 = 100
n2 = 0.025
N = n1+n2
To print them:
sprintf('%.3f', n1+n2)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by