undefined function or variable bits---UMFC vs ODFM
4 次查看(过去 30 天)
显示 更早的评论
hi Peng Li,
please see the code in the link , , , http://www.mathworks.com/help/comm/examples/ufmc-vs-ofdm-modulation.html
ERROR IN UMFC ?((LINE 37)
InpData(:symIdx) = randi({0 1}, 10*bits, 1);
Code not running!!!
please assist
2 个评论
Walter Roberson
2020-5-7
The first parameter to randi should be a numeric scalar, or else a numeric vector with two elements. So randi({0 1}, 10*bits, 1) is wrong because you are passing in a cell instead of a numeric vector, but randi([0 1], 10*bits, 1) might work to assign to inpData(:,symIdx)
采纳的回答
Samatha Aleti
2020-5-7
Hi,
I do not see the line of code you mentioned in the above link, but I assume you are pointing to the following line of code:
inpData(:,bandIdx) = bitsIn; % log bits for comparison
Here “bitsIn” is defined as a vector of bits (randomly generated) whose size depends upon number of bites per carrier “bitsPerSubCarrier” and “subbandSize”, as follows:
subbandSize = 20; % must be > 1
bitsPerSubCarrier = 4; % 2: 4QAM, 4: 16QAM, 6: 64QAM, 8: 256QAM
bitsIn = randi([0 1], bitsPerSubCarrier*subbandSize, 1);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 QAM 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!