Consider this expression
{z1, z2, z3} = Last /@ (List @@ NRoots[(z + 2) (z - 3) (z - 4) == 0, z])
Here's an explanation of what's going on: The NRoots
part returns an Or
. We convert the Or
to a list by applying List@@
. That gives us a list of 3 equations. We take the right hand side of each equation using Last/@
. Then, we set the values of z1
, z2
, z3
by assigning the list to {z1, z2, z3}
, or whatever names we wish.