Binary to Decimal coversion

バージョン 1.0.0.0 (1.6 KB) 作成者: Raviteja
Convert Binary to Decimal Equivalent. It also convert fractional binary values.
ダウンロード: 305
更新 2011/10/5

ライセンスの表示

% 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

引用

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

MATLAB リリースの互換性
作成: R2011a
すべてのリリースと互換性あり
プラットフォームの互換性
Windows macOS Linux
カテゴリ
Help Center および MATLAB AnswersCharacters and Strings についてさらに検索

Community Treasure Hunt

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

Start Hunting!
バージョン 公開済み リリース ノート
1.0.0.0