I am new to MMA. I have a question of joining two lists according to a condition. Suppose I have two lists with same number of elements,
l1={a>b,x>y,m>n}
l2={c>d,False,j>k}
I want to join the two lists according to a condition: join each list's element according to their positions in the list if they both are inequalities. If there is a False in l2, then ignore both elements of that position. For example,
- The first element of l1 is a>b, and the first element of l2 is c>d, then the first element of the new list will be {a>b,c>d}.
- The second element of l1 is x>y, but the second element of l2 is False. So we will ignore position number 2.
- The third element of l1 is m>n, and the third element of l2 is j>k, then the second element of the new list will be{m>n,j>k}.
Therefore, the new list will be {{a>b,c>d},{m>n,j>k}}
.
Another example:
l3={a>b,c>d,x>y,j>k}
l4={False,False,False,m>n}.
Then the new list I want will be {{j>k,m>m}}
Thank you in advance for your generous help!