MathGroup Archive 1993

[Date Index] [Thread Index] [Author Index]

Search the Archive

replacement rules and a simple list


Leon Poon asks if there is an easy way to turn the solutions of 
a Solve from a list of replacement rules to simply elements of 
a list. I think the following rule is very simple.


In[1]:= replace[{a_ -> b_}] := Replace[{a -> b}, {a -> b} -> b]

In[2]:= Solve[x^4==1,x]

Out[2]= {{x -> 1}, {x -> I}, {x -> -1}, {x -> -I}}

In[3]:= Map[replace,%]

Out[3]= {1, I, -1, -I}


Osmo Kolehmainen 





  • Prev by Date: Ordering Mma book
  • Next by Date: curve-fitting
  • Previous by thread: Recording Animation
  • Next by thread: curve-fitting