What is causing the reshaping error?
Show older comments
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');
Accepted Answer
More Answers (0)
Categories
Find more on Language Fundamentals in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!