Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #12143 > unrolled thread

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

Started bypw <p.willis@telus.net>
First post2012-10-22 06:11 +0000
Last post2012-10-22 06:11 +0000
Articles 1 — 1 participant

Back to article view | Back to comp.soft-sys.math.mathematica

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: How to convert the expression 3*x to a function in pw <p.willis@telus.net> - 2012-10-22 06:11 +0000

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

Frompw <p.willis@telus.net>
Date2012-10-22 06:11 +0000
SubjectRe: How to convert the expression 3*x to a function in
Message-ID<k62o2k$cho$1@smc.vnet.net>
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

[toc] | [standalone]


Back to top | Article view | comp.soft-sys.math.mathematica


csiph-web