Binary to Decimal coversion

Convert Binary to Decimal Equivalent. It also convert fractional binary values.
305 download
Aggiornato 5 ott 2011

Visualizza la licenza

% 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

Cita come

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

Compatibilità della release di MATLAB
Creato con R2011a
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Characters and Strings in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0