Real value to binary
조회 수: 10 (최근 30일)
이전 댓글 표시
How can i convert my real value to binary digits?
For example; i have values within [0,25] range and 15 binary digits to represent a variable.(4 variables totally)
How can i do that and also reverse of that?
댓글 수: 3
Walter Roberson
2012년 5월 11일
3 decimal places requires 10 bits to resolve (2^(-10) = 1/1024)
You get slightly better resolution if you use 2^10 than if you use 10^3. It depends though on whether resolution is your goal or if "3 decimal places" is your goal.
채택된 답변
추가 답변 (3개)
Honglei Chen
2012년 5월 11일
Are you asking things like dec2bin and bin2dec?
x = 20;
dec2bin(20,15)
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!