Given a permutation vector perm (a vector of n elements containing all the elements from 1 to n in some order), return the permutation vector invPerm such that perm(invPerm) is the a list of elements from 1 to n.
Solution Stats
Problem Comments
1 Comment
Solution Comments
Show comments
Loading...
Problem Recent Solvers72
Suggested Problems
-
Find all elements less than 0 or greater than 10 and replace them with NaN
15825 Solvers
-
Project Euler: Problem 3, Largest prime factor
1834 Solvers
-
Project Euler: Problem 4, Palindromic numbers
1306 Solvers
-
Return the first and last characters of a character array
12607 Solvers
-
Is this triangle right-angled?
6873 Solvers
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
you should add an example to better explain the question.
For others =>
if, perm = [3, 1, 4, 2]
invPerm = [2, 4, 1, 3] - that is the index of 1 to n.