MATLAB: JUST Take integer value number from decimal value decimal number take integer numberMATLAB if my output is a decimal value but i just want to take the integer value only HOW am i going to do that>??? eg a=4.321323 i just want take 4 , what code should i write?? Best Answer a = -3.1145your_val = fix(a)If you also want it to work for negative numbers. Related SolutionsMATLAB: How can I convert a decimal to an integer fix to strip all the decimalsround can change the integer partfix (1.9) % 1round(1.9) % 2 MATLAB: Floating point value to integer value I suspect that you want to use one of floor() or ceil() or round() or fix() . The four different calls round data slightly differently -- round down, round up, round to nearest, or discard fraction. Related QuestionMatlab integer format for answerHow to round the decimal values
Best Answer