MATLAB: Check for array equality arrayequalityremove How can I check if indices of three arrays are equal and make those indices all zero if they are equal. Best Answer Not sure what the problem is. Why not just this?ind = (A==B) && (A == C);A(ind) = 0;B(ind) = 0;C(ind) = 0;If this is not the answer, then you need to explain yourself FAR more clearly.John Related SolutionsMATLAB: Accessing an array element whose subscript is stored in a vector A = [1,2,3 4,5,6 7,8,9];% Add third dimensionA(:,:,2) = A+9; % Indexind = [2,3,2];ind = num2cell(ind);A(sub2ind(size(A),ind{:})) MATLAB: Equality See the FAQ, which should explain it http://matlab.wikia.com/wiki/FAQ#Why_is_0.3_-_0.2_-_0.1_.28or_similar.29_not_equal_to_zero.3F Related QuestionHow to retrieve only positive values with indexing in matrixHow to plot a hyperplane of a three-variable equality
Best Answer