Hello,
I want to ask you how I can precise the numbers after comma
for example:
x=0.2584
the result should be x=0.2
Please help me!

 채택된 답변

Ameer Hamza
Ameer Hamza 2020년 11월 3일
편집: Ameer Hamza 2020년 11월 3일

0 개 추천

If the numbers are positive
x = 0.2584
y = floor(x*10)/10
If both positive and negative 'x' are possible
y = sign(x)*floor(abs(x)*10)/10

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

릴리스

R2017a

질문:

2020년 11월 3일

편집:

2020년 11월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by