I have a set of Vectors Ai such that i = 1...N; where N can be really large andd vectors contains integers except 0. All vectors are in same length so that's good. I need a function of which the output is a cell array C (the data class is not necessarily cell btw) such that C indices are actually the vector elements and the cell contents are the i indices for A vectors that shares the content.
F : Ai --> C
Example:
A1 = [1 2 4],
A2 = [3 4 5],
A3 = [4 1 2]
the resulting C should be
C{1} = [1 3];
C{2} = [1 3];
C{3} = [2];
C{4} = [1 2 3];
C{5} = [2];
and of course I would like to avoid elementwise for loops.