
Function [p21,r1,n2] = reindexise(p1,n1); returns a vector to rearange indices when unused indices have to be discarded. Items in an array A1, with length n1, are referred to by indices given in array p1. Some items in A1 are not referred to by p1. To discard those unused items and to obtain a new indexation, we can use the function as follows: A1 = [ .... ]; p1 = [ ... indices to A1 ... ]; [p21,r1] = reindicise(p1,length(A1)); A2 = A1(r1); % a new list after discarding non-referenced items p2 = p21(p1); % rearanged indices to the new list (c) 2026 fabien van mook 2026.08.20 release of this file within package "fvm-miscellaneous" under GNU GPLv3+