MATLAB: How to remove decimal?

MATLABremoving fraction

Hello,,
i wanna know how to remove decimal??
Example a = 2.0000
how to remove zero beside point so it will be a = 2??
please help me

Best Answer

To make it clear:
a = 2.00000000001
a =
2.0000
Displaying the integer part ( ans is a char), but a retains the fraction:
sprintf('%.f',a)
ans =
2
Dropping the fraction ( ans is same class as a):
fix(a)
ans =
2