If statement with multiple condition
4 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Hi,
I read few post and could not solve my issue with if statement. I have the following code but it doesn't work!
i=1;
for j = 1 : height (reduced)
if (Boarder_Lat_lower < reduced(j, 4)) && (reduced(j, 4) < Boarder_Lat_upper) && (Boarder_Long_lower < reduced (j, 5)) && (reduced (j, 5) < Boarder_Long_upper)
Selected_2011 (i, :) = reduced (j, :);
i= i+1 ;
end
end
The problem is with multiple conditions separated with "and".
Thank you for the help
7 Kommentare
Walter Roberson
am 22 Sep. 2016
The code would be in error if any of the Boarder_* variables are not scalars.
Antworten (0)
Siehe auch
Kategorien
Mehr zu Tables 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!