hex to binary MATLAB source code
This page of MATLAB source code covers hex to binary conversion.
%function [binary_op] = hex2binyb(data)
hexa='aa83d32'
data=hexa;
% function [binary_op] = hex2binyb(data)
bin = [0 0 0 0;
0 0 0 1;
0 0 1 0;
0 0 1 1;
0 1 0 0;
0 1 0 1;
0 1 1 0;
0 1 1 1;
1 0 0 0;
1 0 0 1;
1 0 1 0;
1 0 1 1;
1 1 0 0;
1 1 0 1;
1 1 1 0;
1 1 1 1];
hex = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'];
data = lower(data);
data1=length(data);
binary_op = [];
for p = 1:data1
index(p) = find(hex == data(p));
binary_op = [binary_op bin(index(p),:)]
end
Input and Output
hexa =
aa83d32
binary_op =
Columns 1 through 17
1 0 1 0 1 0 1 0 1 0 0 0 0 0 1 1 1
Columns 18 through 28
1 0 1 0 0 1 1 0 0 1 0
Useful Links to MATLAB codes
Refer following as well as links mentioned on left side panel for useful MATLAB codes.
OFDM Preamble generation
Time off estimation corr
Freq off estimation corr
channel estimation
11a WLAN channel
PN sequence generation
OFDMA Tx Rx
AES DES
carrier aggregation
CCDF
FIR Filter
IIR Filter
Low Pass FIR
Viterbi decoder
CRC8 CRC32
RF and Wireless tutorials
WLAN 802.11ac 802.11ad wimax Zigbee z-wave GSM LTE UMTS Bluetooth UWB IoT satellite Antenna RADAR