📄 b2f.sci
字号:
function [fval] = b2f(bval,bounds) // binary to float functionscale=(bounds(:,3)'); //The range of the variablesbits=calcbits(bounds); // the bits of variablesnumV=size(bounds,1); // the number of variablescs=[0 cumsum(bits)]; // the cumulated bits of variables for i=1:numV a=bval((cs(i)+1):cs(i+1)); // the bit of a variable fval(i)=sum(2.^(size(a,2)-1:-1:0).*a)*scale(i)*((bounds(i,2)-bounds(i,1))' ./ bounds(i,3)')/(2^bits(i)-1)+bounds(i,1); // float of the i varend
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -