a=randi(10000,[10000,1]);b=randi(10000,[10000,1]);c=randi(100,[10000,10000]);
My question is how to find the row index of c where the c equals 5 (a is the x coordinate and b is the y coordinate).
I can do it using loop:
index=zeros(length(a),1);for i=1:length(a)index(i)=(c(a(i),b(i))==5);endindex1=find(index);
May I know how to do it more efficiently whithout the use of for loop?
Best Answer