how can i convert decimal to hex or another basis without use dec2hex ?
조회 수: 4 (최근 30일)
이전 댓글 표시
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
댓글 수: 0
채택된 답변
Jan
2017년 5월 26일
I really do like this forum. But sometimes I suggest to take the time to search in the net. You can imagine, that this problem has been solved by others already. You find the general algorithm at WikiPedia and most likely your textbook for maths. When you search for "Matlab convert hex to base" you will even find running Matlab code.
댓글 수: 2
Jan
2017년 5월 26일
This is okay. Questions of beginners are welcome in this forum. Specific question get specific answers usually.
추가 답변 (1개)
MathReallyWorks
2017년 5월 26일
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.
댓글 수: 3
참고 항목
카테고리
Help Center 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!