资源简介
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开发-能带计算
- matlab开发-FlockingAlgorithm
- matlab开发-MuellerStokesJonesCalculus
- matlab开发-HX711的自定义数据库
- matlab开发-SMOTEBoost
- matlab开发-果蝇优化算法第二版
- matlab开发-多变量决策树
- matlab开发-水轮发电机模型
- matlab开发-交通警告标志识别标签代码
- matlab开发-RUSBoost
- matlab开发-基于遗传算法的机器人运动
- matlab开发-MPU6050加速度陀螺仪
- matlab开发-功率曲线FAsmallscalewindturbi
- matlab开发-NASAJPLDE405开发星历表
- matlab开发-SortinoRatio
- matlab开发-永磁TDC并联电机数学模型
- matlab开发-3相SPWM整流器
- matlab开发-Kilobotswarm控制Matlabarduino
- matlab开发-简单音频播放
- matlab开发-记录文件的绘图仪加速度、
- matlab开发-永磁同步电机PMSM动态数学模
- matlab开发-多目标优化差分进化算法
- matlab开发-随机微分方程解算
- matlab开发-波长调制光谱的二次谐波模
- matlab开发-仿制药生物生理学基础药动
- matlab开发-使用svmrfe选择功能
- matlab开发-KDTreeNearestNeighborandRangeSear
- matlab开发-stlread
- matlab开发-三维图像堆栈查看器
- matlab开发-动态电压恢复器故障dvr
评论
共有 条评论