The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Inactive » comp.soft-sys.math.mathematica

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: How to convert the expression 3*x to a function in Mathematica?
Replies: 2   Last Post: Oct 22, 2012 2:11 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

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
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.