Assign variables to a module
- To: mathgroup at smc.vnet.net
- Subject: [mg83524] Assign variables to a module
- From: Frank Deicke <frankdeicke at usenet.cnntp.org>
- Date: Thu, 22 Nov 2007 04:45:26 -0500 (EST)
Hello,
I want to assign different variables to a module. One variable could be
a term. Now it could be possible, that the term includes the same
variables like I want to assign to the module. Please look at the simple
example below.
IN:
f = x + y;
Test[c_,x_, y_, f_] := Module[
{result},
result = c*f;(*do something using f*)
result
]
Test[1,1,1,f]
Out:
x+y
Is there any possibility that within the module, the variables x and y
of f could be replaced by the values assigned to the module (x_,y_)?
Finally, the result should be 2 and not x+y.
Thanks,
Frank