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일
Have you decided yet which representation you are going to use ?

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 String Parsing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by