Convert data to binary and ASCII format

2 ビュー (過去 30 日間)
Darren
Darren 2013 年 12 月 9 日
コメント済み: sixwwwwww 2013 年 12 月 9 日
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 件のコメント
sixwwwwww
sixwwwwww 2013 年 12 月 9 日
In how many bits you will like to represent a binary number?

サインインしてコメントする。

回答 (1 件)

sixwwwwww
sixwwwwww 2013 年 12 月 9 日
編集済み: sixwwwwww 2013 年 12 月 9 日
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 件のコメント
Walter Roberson
Walter Roberson 2013 年 12 月 9 日
Walter Roberson
Walter Roberson 2013 年 12 月 9 日
Have you decided yet which representation you are going to use ?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeString Parsing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by