资源简介
matlab开发-IEEE754二进制表示。将double转换为其基础的64位表示形式,包括符号、指数和尾数。
代码片段和文件信息
function [sef] = ieee754(xfmt)
%IEEE754 Decompose a double precision floating point number.
% [SEF] = IEEE754(X) returns the sign bit exponent and mantissa of an
% IEEE 754 floating point value X expressed as binary digit strings of
% length 1 11 and 52 respectively.
%
% S = IEEE754(X) returns one string of length 64.
%
% [SEF] = IEEE754(X‘dec‘) returns S E and F as floating-point numbers.
%
% X is equal to (in exact arithmetic and decimal notation)
%
% (-1)^S * (1 + F/(2^52)) * 2^(E-1023)
%
% except for special values 0 Inf NaN and denormalized numbers (between
% 0 and REALMIN).
%
% See also FORMAT REALMAX REALMIN BIN2DEC.
% Copyright 2009 by Toby Driscoll (driscoll@udel.edu).
% Thanks to Andreas Luettgens for the suggestion of NUM2HEX.
if ~isreal(x) || numel(x) > 1 || ~isa(x‘double‘)
error(‘Real scalar double input required.‘)
end
hex = num2hex(x); % string of 16 hex digits for x
dec = hex2dec(hex‘); % decimal for each digit (1 per row)
bin = dec2bin(dec4); % 4 binary digits per row
bitstr = reshape(bin‘[1 64]); % string of 64 bits in order
% Return options
if nargout<2
s = bitstr;
else
s = bitstr(1);
e = bitstr(2:12);
f = bitstr(13:64);
if nargin > 1 && isequal(lower(fmt)‘dec‘)
s = bin2dec(s); e = bin2dec(e); f = bin2dec(f);
end
end
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 1337 2013-10-30 20:41 ieee754.m
文件 1314 2014-02-12 14:37 license.txt
相关资源
- matlab开发-kmvcreditriskmodel违约风险概率
- matlab开发-17电平模块多电平转换器
- matlab开发-Xfoilformatlab
- matlab开发-脑瘤的分割
- matlab开发-车辆网络工具箱支持kvaser和
- matlab开发-CryoSat2DEMs
- matlab开发-BlandAltmanplot
- matlab开发-使用PSO的最佳模糊控制器
- matlab开发-电机磁轴承
- matlab开发-Treynorblackportfoliomanagement模型
- matlab开发-黑白图像增强器
- matlab开发-二维波动方程模拟
- matlab开发-ResponseSpectra
- matlab开发-huashiyiqikeLSTMMATLAB
- matlab开发-HestonOptionPricer
- matlab开发-三相电压调节器
- matlab开发-单级电液伺服阀
-
matlab开发-iau2006 acioba
sedDusingXy系列 - matlab开发-带DPWM0调制的三相逆变器
- matlab开发-Earthquakesimulation
- matlab开发-带MPPT的住宅网格连接PVSys
- matlab开发-pplot
评论
共有 条评论