Binary to Decimal coversion

Versión 1.0.0.0 (1,6 KB) por Raviteja
Convert Binary to Decimal Equivalent. It also convert fractional binary values.
305 descargas
Actualizado 5 oct 2011

Ver licencia

% BIN2DECIMAL Function convert binary string to decimal equivalent.
% This program also works for fractional binary numbers.
% Input: Binary string
% Output: Decimal equivalent of input Binary string
%
% NOTE: keep format as long for high floating point precision
% >>format long
%
% A white space is assumed to be . (point)
% >>bin2decimal('10101') returns 21
% >>bin2decimal('10.101') returns 2.625000000000000
% >>bin2decimal('10 101') returns 2.625000000000000
% >>bin2decimal('.10101') returns 0.656250000000000
% >>bin2decimal(' 10101') returns 0.656250000000000

Citar como

Raviteja (2024). Binary to Decimal coversion (https://www.mathworks.com/matlabcentral/fileexchange/33139-binary-to-decimal-coversion), MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2011a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Categorías
Más información sobre Characters and Strings en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión
1.0.0.0