current position:Home>How to remove the row containing 0 in a matrix in MATLAB

How to remove the row containing 0 in a matrix in MATLAB

2022-01-27 03:00:25 CSDN Q & A

Now there is a N That's ok ,2 Columns of the matrix ,2 Some elements in the column are 0, How to find the containing 0 The line of , Then put the containing 0 Take out the whole line of




Refer to the answer 1:

Suppose the original matrix is A, Delete include 0 The matrix after the row of is B, The procedure is as follows :

A = [1 2;3 0;0 0];B = A((A(:,1)~=0).*(A(:,2)~=0)==1,:);



Refer to the answer 2:

copyright notice
author[CSDN Q & A],Please bring the original link to reprint, thank you.
https://en.cdmana.com/2022/01/202201270300235162.html

Random recommended