How to check if everything below the column is zero

2 Ansichten (letzte 30 Tage)
Natalie Murawski
Natalie Murawski am 27 Sep. 2019
Kommentiert: Natalie Murawski am 27 Sep. 2019
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
Natalie Murawski
Natalie Murawski am 27 Sep. 2019
Thank you! It works!

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by