How to check if everything below the column is zero
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I have a matrix,
[1 2 3; 0 1 0; 0 1 1]
And I want to check if everything below a certain element is zero. For example, at A(2, 2) the element below is not zero so I want to output false. I have the following
idy=1:size(A,1)<i %rows less than i
if all(A(i,idy)==0)
x=true;
end
However, I do not believe it's right, can anyone help me fix it please. Thanks!
4 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Logical finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!