function [bin]=hex2bin(x)
%dec2bin(hex2dec('2BBCF3'))
hex=x;
bin=[];
for i=1:length(hex)
    
    if hex(i)=='F'
        %bin((i*4)-3:i*4)=[1 1 1 1];
        bin=[[bin] [1 1 1 1]];
    elseif hex(i)=='E'
        %bin((i*4)-3:i*4)=[1 1 1 0];
        bin=[[bin] [1 1 1 0]];
    elseif hex(i)=='D'
        %bin((i*4)-3:i*4)=[1 1 0 1];
        bin=[[bin] [1 1 0 1]];
    elseif hex(i)=='C'
        %bin((i*4)-3:i*4)=[1 1 0 0];
        bin=[[bin] [1 1 0 0]];
    elseif hex(i)=='B'
        %bin((i*4)-3:i*4)=[1 0 1 1];
        bin=[[bin] [1 0 1 1]];
    elseif hex(i)=='A'
        %bin((i*4)-3:i*4)=[1 0 1 0];
        bin=[[bin] [1 0 1 0]];
    elseif hex(i)=='9'
        %bin((i*4)-3:i*4)=[1 0 0 1];
        bin=[[bin] [1 0 0 1]];
    elseif hex(i)=='8'
        %bin((i*4)-3:i*4)=[1 0 0 0];
        bin=[[bin] [1 0 0 0]];
    elseif hex(i)=='7'
        %bin((i*4)-3:i*4)=[0 1 1 1];
        bin=[[bin] [0 1 1 1]];
    elseif hex(i)=='6'
        %bin((i*4)-3:i*4)=[0 1 1 0];
        bin=[[bin] [0 1 1 0]];
    elseif hex(i)=='5'
        %bin((i*4)-3:i*4)=[0 1 0 1];
        bin=[[bin] [0 1 0 1]];
    elseif hex(i)=='4'
        %bin((i*4)-3:i*4)=[0 1 0 0];
        bin=[[bin] [0 1 0 0]];
    elseif hex(i)=='3'
        %bin((i*4)-3:i*4)=[0 0 1 1];
        bin=[[bin] [0 0 1 1]];
    elseif hex(i)=='2'
        %bin((i*4)-3:i*4)=[0 0 1 0];
        bin=[[bin] [0 0 1 0]];
    elseif hex(i)=='1'
        %bin((i*4)-3:i*4)=[0 0 0 1];
        bin=[[bin] [0 0 0 1]];
    elseif hex(i)=='0'
        %bin((i*4)-3:i*4)=[0 0 0 0];
        bin=[[bin] [0 0 0 0]];
    elseif hex(i)=='_'
        bin=[[bin] []];
    end
end  