What is causing the reshaping error?
显示 更早的评论
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');
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Language Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!