Remove Decimal part from number

조회 수: 5 (최근 30일)
m
m 2016년 1월 2일
댓글: Guillaume 2016년 1월 2일
i have a series of 100 arrays which contain about 4-5 digits number. for example, x=9588
i want x/256=37.453, i want to remove the .453 leaving only 37. then 37 * 256 = 9472, then 9588-9472=116,
i want the final answer to be like 116.
i have tried, floor, round and fix.but still not getting the answer i want. is it anything to do with the integer class? because all the number of array in int32. please help me. thank you
  댓글 수: 1
Guillaume
Guillaume 2016년 1월 2일
What you're asking is a modulo operation. See dpb's answer.

댓글을 달려면 로그인하십시오.

채택된 답변

dpb
dpb 2016년 1월 2일
doc mod
>> mod(9588,256)
ans =
116
>>

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by