MATLAB: Finding location of logical 1 row wise by column findlocationlogical?MATLAB Hi, I have a 8 x 621 logical and I would like to extract the row location of the logical 1 by columns i.e the result should be ans = [ 5 8 3 8 ….] How may I do that? Thank you! Best Answer [idr,~] = find(yourMatrix) Related SolutionsMATLAB: Finding the row/column locations of 1s in a boolean matrix A = rand(3)>.5;[I,J] = find(A) % I is the rows, J is the cols. MATLAB: How to find which row has a specied values that I entered For example, A=[4 5 6 7; 8 4 5 6; 4 5 6 8; 8 4 8 9 ;1 2 2 4; 4 5 6 8]; % A matrixv = [4 5 6 8]; % vector you are searching for[flag,locs] = ismember(A,v,'rows'); % flag gives logical true for each row if v is equal to corresponding row of A locations = find(flag); % if you want to get exact location such as 3rd row, 5th row and if you are using with rows option, use this. Related QuestionFinding mean in row wiseFind row and collumnumber in matrix.Row & Column Wise NormalisationConverting numbers into logicalsLogical indexing for row-wise averageFind row index of first ‘True’ value in column of tableRow Wise concatenation
Best Answer