Efficient convertors between binary and decimal numbers
by Zacharias Voulgaris
21 Jan 2010
Alternatives to the built-in functions bin2dec & dec2bin, exhibiting a somewhat faster performance.
|
Watch this File
|
| File Information |
| Description |
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)
|
| MATLAB release |
MATLAB 7.8 (R2009a)
|
| Other requirements |
These programs are quite simple, so they can probably run smoothly on even the earliest releases of Matlab. |
|
Tags for This File
|
| Everyone's Tags |
|
| Tags I've Applied |
|
| Add New Tags |
Please login to tag files.
|
|
Contact us at files@mathworks.com