how can i convert decimal to hex or another basis without use dec2hex ?
Show older comments
I need to make a function about convert basis to another (decimal to oktal or another) but i dont know the prinsip , i hope some one give me tips for that
Accepted Answer
More Answers (1)
MathReallyWorks
on 26 May 2017
2 votes
Hello Mohammad Imam Malik,
I guess you are asking for the principle behind these conversions.
Read this:
Steps:(Decimal to hex)
1. Divide the decimal number by 16. Treat the division as an integer division.
2. Write down the remainder (in hexadecimal).
3. Divide the result again by 16. Treat the division as an integer division.
4. Repeat step 2 and 3 until result is 0.
5. The hex value is the digit sequence of the remainders from the last to first.
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!