Converting decimal to binary with output data type 'double'

6 visualizzazioni (ultimi 30 giorni)
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...)

Risposte (1)

Walter Roberson
Walter Roberson il 1 Gen 2014
dec2bin(YourNumber, 8) - '0'
  4 Commenti
Image Analyst
Image Analyst il 1 Gen 2014
Mark as Accepted, so people like me don't need to open this discussion unnecessarily, and so Walter gets credit for helping you.

Accedi per commentare.

Categorie

Scopri di più su Data Type Conversion in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by