MATLAB: How to remove some elements from a matrix arrayMATLABmatrixremove Hi everyone Now I have a matrix which has two columns and several rows. How can I remove the rows which contains value that read 0 and create a new matrix? Any help would be really appreciated! Best Answer The find function with two outputs is helpful here:M = randi([0 10], 20, 2); % Create Data[r,~] = find(M == 0); % Rows With ‘0’M(r,:) = []; % Delete Rows With ‘0’ Related SolutionsMATLAB: How to eliminate column of the matrix A(:,all(A==0)) = [] MATLAB: Delete zero columns in images A= [ 1 0 2 3 4 ;0 0 5 4 3 ;5 0 7 6 5;3 0 4 3 0]AA=A(:,any(A)) Related QuestionWhich row has the minimum non zero elementHow to remove redundant rows in a matrixHow to find number in a matrix and output its row numberHow do you extract certain rows from one matrix thats first column has specific values and create a new matrix containing those rowsFilter matrix according to column
Best Answer