Hi, I have a 3d tensor in MATLAB. Call it A. Lets say, size(A)=[4 6 10]. I have another matrix M which holds few indexes of the first two dimensions of the matrix A. Like
M=[1 5;3 2;1 4];
Now, I want to set all elements of the matrix A as zero which has the different index (of the first two dimensions) than the matrix M. Basically, what I want to do is-
A((if index(A{1,2})~=M),:)=0
Please help me.
Best Answer