Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.


pw
Posts:
14
Registered:
10/3/12


Re: How to convert the expression 3*x to a function in
Posted:
Oct 22, 2012 2:11 AM


On 10/20/2012 11:10 PM, pedro_fr_22@hotmail.com wrote: > In doing a program in Mathematica that receives an expression called f and converts it to a function. However the command Function[x,f] doesn't work, what do I do? > >
(*The Function Declaration*)
MyFunction[x_, c_] := x*c
(*Calling The Function*)
x = 12
B = MyFunction[x , 3]
Or if you always want to multiply by 3,
MyFunction[x_] := x*3
x = 12
B = MyFunction[x]
Peter



