Convert data to binary and ASCII format
显示 更早的评论
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
2013-12-9
In how many bits you will like to represent a binary number?
回答(1 个)
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 个评论
Darren
2013-12-9
Walter Roberson
2013-12-9
There are three different "standards" for converting negative integers. You need to decide which one you are going to use: sign bit, one's complement, or two's complement.
You can save the converted to disk using fprintf() or fwrite(); or you can use save(); or you can use one of the higher level routines such as csvwrite() or dlmwrite() or xlswrite().
Darren
2013-12-9
Walter Roberson
2013-12-9
Have you decided yet which representation you are going to use ?
类别
在 帮助中心 和 File Exchange 中查找有关 Spreadsheets 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!