I have two large vectors X and Y holding indices. Lets say
X = [1; 2; 3; 4; 1; 4;......]Y = [10; 21; 4; 4; 10; 7;......]
I want to get the indices for a given values of a and b, like for example for a = 1 and b = 10, I must get the indices 1 and 5.
I could do that with the use of find() as follows
parfor a = 1:N for b = 1:M Indices_list{a,b} = find(and((X == a), (Y == b))); endend
In spite of using parfor, it it still taking a lot of time. Please help me if there is a faster way to achieve this.
Best Answer