MathGroup Archive 2012

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

Search the Archive

Re: How to convert the expression 3*x to a function in


On 10/20/2012 11:10 PM, pedro_fr_22 at 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



  • Prev by Date: Re: How to convert the expression 3*x to a function in Mathematica?
  • Next by Date: Re: How to convert the expression 3*x to a function in Mathematica?
  • Previous by thread: Re: How to convert the expression 3*x to a function in Mathematica?
  • Next by thread: Re: How to convert the expression 3*x to a function in Mathematica?