📄 bin2flt.m
字号:
function f = bin2flt(c)
% bin2flt Expand a binary representation of floating point mantissa
%
% Synopsis: f = bin2flt(c)
%
% Input: c = (string) bit sequence of the fractional part of a normalized
% floating point number.
%
% Output f = numerical equivalent of the bit pattern
% f = sum(k=1:n){ c(k)*2^(-k) }
f=0;
for k=1:length(c)
f = f + str2num(c(k))*2^(-k);
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -