RF Wireless World

Browse articles, tutorials, tools, and vendors.

Hexadecimal to Decimal Conversion in MATLAB

This page provides MATLAB source code for hexadecimal to decimal conversion using the hex2dec function.

Function Definition:

output = hex2dec(input)

This MATLAB function converts a hexadecimal string to its decimal equivalent integer.

Example:

input = 'FFFF';
output = hex2dec(input)
output = 65535

Explanation:

The hex2dec function takes a string representing a hexadecimal number as input and returns its decimal representation as a numerical value. In the example above, the hexadecimal string ‘FFFF’ is converted to the decimal number 65535.