Sorry if this is a duplicate, but I have a variable called H
. H
is some complicated function of s
.
Now I want to make this variable H
into a formal function f[s]
. I've tried just doing
f[s_] := H
But that doesn't seem to work.
H
was initially a value in a InputField
and the type on that InputField
was an Expression
.
Any ideas on how I can turn this into a proper Mathematica function?
h = 3*s - 1; f[s_] := Evaluate@h;
thenf[3]
$\endgroup$ – Nasser Mar 12 '14 at 23:34