Question: Removing elements from a list.

Hello there, 

I have been having trouble removing elements from a list using the subsop tool.

I have a list A containing smaller lists of 2 values (A=[[0,1],[2,2],[4,5],[-1,-2], ... ]). My goal is to set boudaries to these sublists such as if the "y" (second value in any sublist) value is greater than 3, remove it from the list. here is what my code looks like

 

for i from i to n do
  if evalf(op(2,op(i,A))) < 0 then 
    subsop(i=NULL,A);
  fi;
od;

where n is the size of the list A. In this case, i want to remove "y" values greater than 0. I tried this in my maple code, however the expected values are not removed. I use evalf here because the values in my sublists are ~10^-10*sqrt(3) and the greater/lesser than statement doesnt work without evalf.

where n is the size of the list A. In this case, i want to remove "y" values greater than 0. I tried this in my maple code, however the expected values are not removed. I use evalf here because the values in my sublists are ~10^-10*sqrt(3) and the greater/lesser than statement doesnt work without evalf.

What if i wanted not simply y<0 but y<2x or something?

Thank you very much!

Please Wait...