Convert data to binary and ASCII format

2 Ansichten (letzte 30 Tage)
Darren
Darren am 9 Dez. 2013
Kommentiert: sixwwwwww am 9 Dez. 2013
If the variable
a=[3 2 1; 1 2 3; 2 3 1]
b=[1 2 3; 4 6 7; 5 3 5]
c=[a*b]
How to I save each variable as binary format and ASCII format?
  1 Kommentar
sixwwwwww
sixwwwwww am 9 Dez. 2013
In how many bits you will like to represent a binary number?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

sixwwwwww
sixwwwwww am 9 Dez. 2013
Bearbeitet: sixwwwwww am 9 Dez. 2013
You can do it as follow:
a = [3 2 1; 1 2 3; 2 3 1];
dec2bin(a) % decimal to binary conversion
b = double(num2str(a)) % decimal to ASCII conversion
  5 Kommentare
Walter Roberson
Walter Roberson am 9 Dez. 2013
Have you decided yet which representation you are going to use ?

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