Efficient convertors between binary and decimal numbers

Alternatives to the built-in functions bin2dec & dec2bin, exhibiting a somewhat faster performance.

您现在正在关注此提交

These programs were developed for fast conversions between binary and decimal integers (there are other programs by fellow Matlab-users, dealing with fractions). They can be useful when the binary numbers are in vector form instead of strings.

b2d takes a binary number in the form of an array and calculates the equivalent decimal one. Nothing fancy, but quite effective as a component of a program that needs to be efficient in terms of computational overhead.

d2b is the symmetrical program, taking a decimal number and providing the equivalent binary one, in the form of an array.

Usage: y = b2d(x), y = d2b(x)

引用格式

Zacharias Voulgaris (2026). Efficient convertors between binary and decimal numbers (https://ww2.mathworks.cn/matlabcentral/fileexchange/26447-efficient-convertors-between-binary-and-decimal-numbers), MATLAB Central File Exchange. 检索时间: .

类别

Help CenterMATLAB Answers 中查找有关 Data Type Conversion 的更多信息

一般信息

MATLAB 版本兼容性

  • 兼容任何版本

平台兼容性

  • Windows
  • macOS
  • Linux
版本 已发布 发行说明 Action
1.0.0.0