Filter löschen
Filter löschen

Converting decimal to binary with output data type 'double'

4 Ansichten (letzte 30 Tage)
Daniel
Daniel am 1 Jan. 2014
Kommentiert: mak khatib am 5 Dez. 2017
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...)

Antworten (1)

Walter Roberson
Walter Roberson am 1 Jan. 2014
dec2bin(YourNumber, 8) - '0'
  4 Kommentare
Image Analyst
Image Analyst am 1 Jan. 2014
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 am 5 Dez. 2017
Thank you Mr. Walter!

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Data Type Conversion finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by