Hi, i would call this a rather bitter solution for a beginner to understand, but it is short and it works, if you want to understand it you should first look what a<100 does when "a" is a matrix (you shouldnt use this for if statements) and then combind it with &
a=randi(900,15,2);
a(a(:,1)>100 & a(:,1)<550,:)=[];
a(a(:,2)>100 & a(:,2)<420,:)=[];
a =
580 176
341 204
731 154
480 205
316 393
846 280
789 832
496 388
561 167
529 815
187 882
272 395
424 101
208 233
760 368
a =
580 176
731 154
846 280
789 832
561 167
760 368
a =
789 832
Best Answer