Hexadecimal to binary

version 1.0.0.0 (1.92 KB) by Tamir Suliman
HEX2BIN Convert hexdecimal string to a binary string.

1.2K Downloads

Updated 26 Dec 2012

View License

% HEX2BIN(h) returns the binary representation of h as a string.
%
%
% HEX2BIN(h,n) produces a binary representation with at least
% N bits.
%
% Example
% hex2bin('f') returns '1111'
% hex2bin('fa') returns '1111 1010'
% hex2bin(['f' 'a'],4) returns
% 0010 1111
% See also BIN2DEC, DEC2HEX, DEC2BASE.

%
% This function implemented with the help of hex2dec and dec2bin

Cite As

Tamir Suliman (2022). Hexadecimal to binary (https://www.mathworks.com/matlabcentral/fileexchange/39645-hexadecimal-to-binary), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2010a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

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

Start Hunting!