MATLAB: How to assign only first member in matrix matrix manipulation I am using q(t) = find(A == max1(t)); But problem here is in max1(4) has value of 134 and in A 134 is repeated two times I want only first location of 134 how to do that ? Best Answer q(t) = find(A == max1(t),1,'first') Related SolutionsMATLAB: Assigning cell to variable only assigns first value Use parentheses instead:behaviours = obj.catsBehavs(1, behaviourIndices);You want to keep the cell array type so don't use { } to extract what is in it instead MATLAB: Finding the first 1 in indicator variable out = find(A,1,'first')A - your indicator variable (vector)[outI,outJ] = find(A,1,'first')here A - your indicator variable (matrix) Related QuestionListing only the first indexHow to find elements in a matrixActxserver reading only first fileReplace only the first matchFine the first index of the value that is greater than zero along specific dimension.
Best Answer