Understanding the following step in MATLAB
Show older comments
Hello all, I came across the following code on MATLAB but not getting its last step:
symbols = randi([0 3], 1, 256);
constellation = [1+1i, -1+1i, -1-1i, 1-1i];
signal = constellation(symbols + 1); % Last step
My query is why " symbols +1 " is written in last step and why not only " symbols".
Any help in this regard will be highly appreciated.
Accepted Answer
More Answers (1)
The elements in symbols range from 0 - 3, but Matlab uses 1-based indexing, i.e. the indices int0 constellation can only be 1-4.
1 Comment
charu shree
on 5 Jul 2023
Categories
Find more on Creating and Concatenating Matrices 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!