Hello, I have two lists
p={2,5,-6,8,3}
and
q ={3,-4,0,5,0}
I want to get the list
p/q = {2/3,5/-4,8/5}
which is obtained by dividing elements of p by elements of q one by one avoiding division by zeros. Code p/q yields
"infinite expression 1/0 encountered"
Please help. Thanks and regards
Hello Frank, Thanks a lot. It helped me write a code for simplex method in OR.
Divide @@@ Pick[Transpose[{p, q}], Unitize@q, 1]
Elegant !
p = {2, 5, -6, 8, 3}; q = {3, -4, 0, 5, 0}; Off[Power::infy] Select[p/q, NumberQ[#] &] {2/3, -(5/4), 8/5}