how to define 4 bit Enumerated value and a nibble(4 bits) in Matlab
6 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
PTP
am 20 Jan. 2016
Kommentiert: Walter Roberson
am 1 Feb. 2016
Hello,
how to define 4 bit Enumerated value and a nibble(4 bits) in Matlab
0 Kommentare
Akzeptierte Antwort
Thorsten
am 20 Jan. 2016
Use a number between 0 and 15.
n = 8;
To convert to binary
nbin = dec2bin(n) - '0';
dec2bin return a string, the -'0' converts this string to an array of 0's and 1's.
5 Kommentare
Walter Roberson
am 1 Feb. 2016
sBytes = uint8(s);
send sBytes. Reconstruct on the other side with
s = char(sBytes);
Do not bother converting to bits!!
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Dates and Time 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!