0
$\begingroup$

Can I use the output of reduce to define a variable in a function definition? In other words, can I somehow skip the step where I manually enter t:=2?

Reduce[{-2 + t == 0,3 t == 6,4 + t == 6},t]
t==2
t := 2
f[x_, y_, z_] = {-2 + t, 3 t, 4 + t}
{0, 6, 6}

I tried ./ and ToRule, neither seem to work

$\endgroup$
2
  • $\begingroup$ ClearAll[t]; sol = ToRules@Reduce[{-2 + t == 0, 3 t == 6, 4 + t == 6}, t]; $\endgroup$
    – kglr
    Mar 26 '18 at 22:47
  • $\begingroup$ that's... interesting. I wish there was some less convoluted technique, but if y'all decide which one of you wants to write an answer I will accept it. $\endgroup$
    – jamesson
    Mar 26 '18 at 23:13
2
$\begingroup$
ClearAll[t]; t=t/.ToRules[Reduce[{-2 + t == 0,3 t == 6,4 + t == 6},t]]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.