필터 지우기
필터 지우기

Converting decimal to binary with output data type 'double'

조회 수: 4 (최근 30일)
Daniel
Daniel 2014년 1월 1일
댓글: mak khatib 2017년 12월 5일
Hello, I am trying to convert decimal to binary.
I know that I need to use dec2bin; however, I want my binary number to be
a double instead of character.
Any idea how?
(The reason behind this is, because I will be implementing this in Simulink, which does not support char...)

답변 (1개)

Walter Roberson
Walter Roberson 2014년 1월 1일
dec2bin(YourNumber, 8) - '0'
  댓글 수: 4
Image Analyst
Image Analyst 2014년 1월 1일
Mark as Accepted, so people like me don't need to open this discussion unnecessarily, and so Walter gets credit for helping you.
mak khatib
mak khatib 2017년 12월 5일
Thank you Mr. Walter!

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

카테고리

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