size argument must be real integer

조회 수: 12 (최근 30일)
Aqsal Renaldi
Aqsal Renaldi 2021년 11월 30일
댓글: Aqsal Renaldi 2021년 11월 30일
M = 128; % Modulation order (alphabet size or number of points in signal constellation)
k = log2(M); % Number of bits per symbol
n = 30000; % Number of bits to process
sps = 1; % Number of samples per symbol (oversampling factor)
rng default;
dataIn = randi([0 1],n,1); % Generate vector of binary data
stem(dataIn(1:40),'filled');
title('Random Bits');
xlabel('Bit Index');
ylabel('Binary Value');
dataInMatrix = reshape(dataIn,length(dataIn)/k,k);
dataSymbolsIn = bi2de(dataInMatrix);
Error reshape, size argument must be real integer

채택된 답변

Voss
Voss 2021년 11월 30일
30000 bits
7 bits per symbol
--> 30000/7 = non-integer number of symbols, i.e., you cannot reshape dataIn into a matrix of symbols
  댓글 수: 1
Aqsal Renaldi
Aqsal Renaldi 2021년 11월 30일
thank you so much sir, you helped me

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 QAM에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by