Binary to Decimal coversion

Version 1.0.0.0 (1,6 ko) par Raviteja
Convert Binary to Decimal Equivalent. It also convert fractional binary values.
305 téléchargements
Mise à jour 5 oct. 2011

Afficher la licence

% 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

Citation pour cette source

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

Compatibilité avec les versions de MATLAB
Créé avec R2011a
Compatible avec toutes les versions
Plateformes compatibles
Windows macOS Linux
Catégories
En savoir plus sur Characters and Strings dans Help Center et MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Version Publié le Notes de version
1.0.0.0