How to convert decimal to binary which includes decimal values for eg 1.25.

조회 수: 5 (최근 30일)
I tried using de2bi but it doesn't account for decimal values like 1.25, 3.2, etc. If somebody has a solution to this problem.

채택된 답변

Sreedhar Arumugam
Sreedhar Arumugam 2021년 9월 8일
It is my understanding that you want to convert a floating point number in decimal format to its binary equivalent.
The de2bi and dec2bin functions are used to convert a decimal integer to its binary representation. It will not account for the fractional part of your number.
Please refer to this answer to understand how to convert a floating point number to its binary equivalent :

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Conversion에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by