From: Diego Lass on
Hi
I want to recover the original position of element

example
A = [3; 4; 5; 6; 7; 8]
B = [true;false;true;false;true;true]
C = [2; 3; 4]

A is the original matrix.
B is the element that are taken from A, i.e.
temp = A(B,:) =
3
5
7
8
C is the position of some desired element in B, i.e.
desired = temp(C) =
5
7
8

So the position of desired in A is [3,5,6]

Now we are given A, B, C, desired. How can we recover the position of desired in the most efficient way?

Thanks.
Diego