Problem 53950. Time reverse indices
Time reverse the index values as follows
IndexIn = [7 1 0]
IndexOut = [7 6 0]
Note that the indices are zero based and sorted from largest to smallest.
You can think of this as a time reversal of a vector:
[7 1 0] --> [1 1 0 0 0 0 0 1 ]
[7 6 0] --> [1 0 0 0 0 0 1 1 ]
Here is a second example
[8 4 3 2 0] --> [ 1 0 1 1 1 0 0 0 1 ]
[8 6 5 4 0] --> [ 1 0 0 0 1 1 1 0 1 ]
Background of problem. The index defines the tap positions (or characteristic polynomial) of a Linear Feedback Shift Register (LFSR). When the polynomial is primitive, the LFSR goes through all possible states before repeating, thus creating a psuedo random binary sequence (PRBS). A curious property is that if the tap positions are reversed, as we are doing in this problem, then the output sequence is also reversed.
Solution Stats
Problem Comments
Solution Comments
Show commentsProblem Recent Solvers14
Suggested Problems
-
Replace NaNs with the number that appears to its left in the row.
2919 Solvers
-
Given an unsigned integer x, find the largest y by rearranging the bits in x
1693 Solvers
-
1107 Solvers
-
Return the first and last characters of a character array
9105 Solvers
-
Duplicate each element of a vector.
596 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!