inv(p) returns the inverse permutation of p
0001 function q = inv(p) 0002 % inv(p) returns the inverse permutation of p 0003 a = array(p); 0004 [y,b] = sort(a); 0005 q = permutation(b);