1.571과 같은 십진수를 이진수로 변환하면 정수가 아닌 모든 값이 0이됩니다. MATLAB에서 바이너리로 분수를 표시하는 방법이 있습니까? 그런 다음 dec2bin
을 typecast
를 사용 UINT64하고 사용하도록 복식을 변환 할 수MATLAB에서 정수가 아닌 숫자를 이진수로 변환
%The region between 0 and 2*pi is split up into 40 sections
N=20;
%The step is an the incrementation amount of the calculated sin
step= (2*pi)/40
%Cycle through and calculate the sin at each step
for i=1:N
C_r(i) = sin(step*i)
end
for i = 1 : N
str_r = dec2bin(C_r(i),24);
end
['dec2bin'] (http://www.mathworks.com/help/matlab/ref/dec2bin.html)의 문서에 따르면 ** 정확한 ** 바이너리 표현은 'ui '는 2^52까지입니다. – Matt