What is causing the reshaping error?
Mostra commenti meno recenti
I was playing with the number n, and sometime reshape gives an error when it is too small? Can somone help me deduce what is actually going on here?
M = 64;
k = log2(M);
n = 128;
numSamplesPerSymbol = 1;
rng default
dataIn = randi([0 1], n, 1);
stem(dataIn(1:128), 'filled');
title('Random Bits');
xlabel('Bit Index');
ylabel('Binary Value');
dataInMatrix = reshape(dataIn, length(dataIn)/k, k);
dataSymbolsIn = bi2de(dataInMatrix);
% dataSymbolsIn = b2d(dataInMatrix);
figure;
stem(dataSymbolsIn(1:50));
title('RandomYmbols');
xlabel('Symbol Index');
ylabel('Integer Value');
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Language Fundamentals in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!