How can I convert a list of rules
{a -> 1, b-> 2, c-> 3, d-> 4}
to a row matrix by removing the keys like
{1, 2, 3, 4
}.
thanks
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityIf you define rule = {a -> 1, b -> 2, c -> 3, d -> 4}
, then there are at least four ways that can reach what you want:
rule[[All, 2]]
Thread[rule, Rule][[2]]
Cases[rule, _?NumericQ, 2]
rule /. Rule[_Symbol, a_Integer] :> a
Values@rules
$\endgroup$