# Can someone help me? - Plotting complex number with index

조회 수: 2(최근 30일)
댓글: Sulaymon Eshkabilov 2021년 5월 27일
I plotted complex numbers as follows:
and I got some complex numbers, like for example:
result plot:
how do I put the corresponding bit values (1000,1100, ...) according to the example below???
Can someone help me?

댓글을 달려면 로그인하십시오.

### 채택된 답변

Sulaymon Eshkabilov 2021년 5월 27일
Hi,
Here is the answer to convert imaginary and real numbers from a floating point format into binary:
N = 16; % Number bits for integer part:
M = 25; % Number bits for fraction part:
% Conversion from floating point format into binary number
%% REAL Part:
for ii=1:numel(q_real)
BIN1(ii,:) = fix(rem(q_real(ii)*pow2(-(N-1):M),2));
% Test the inverse transformation
DEC1(ii) = BIN1(ii,:)*pow2(n-1:-1:-m).';
end
%% IMAG Part:
for ii=1:numel(q_imag)
BIN2(ii,:) = fix(rem(q_imag(ii)*pow2(-(N-1):M),2));
% Test the inverse transformation
DEC2(ii) = BIN2(ii,:)*pow2(n-1:-1:-m).';
end
Good luck.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
Sulaymon Eshkabilov 2021년 5월 27일
Most Welcome!

댓글을 달려면 로그인하십시오.

### 추가 답변(1개)

Sulaymon Eshkabilov 2021년 5월 26일

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by