필터 지우기
필터 지우기

i have an value as 6.5.give me the syntax to get the whole number 6

조회 수: 3 (최근 30일)
i have an value as 6.5.give me the syntax to get the whole number 6

채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2012년 11월 1일
편집: Azzi Abdelmalek 2012년 11월 1일
a=6.5
fix (a)
% for other rounding look at round, ceil command

추가 답변 (1개)

Image Analyst
Image Analyst 2012년 11월 1일
Do you want a floating point number or an integer? Here it is both ways:
v = 6.5;
vDouble = floor(v)
class(vDouble)
vInt = int32(floor(v))
class(vInt)
In the command window:
vDouble =
6
ans =
double
vInt =
6
ans =
int32

카테고리

Help CenterFile Exchange에서 Solver Outputs and Iterative Display에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by