newbie question on functions
- To: mathgroup at smc.vnet.net
- Subject: [mg51750] newbie question on functions
- From: Todd Allen <genesplicer28 at yahoo.com>
- Date: Sun, 31 Oct 2004 01:17:36 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi all, I have what is probably a nieve question, but it is giving me some difficulty. I am trying to generate a function in which I pass two columns of information from a matrix to this function to perform some calculations. I can successfully pass the data and get the resulting calculation......but the problem is the function returns the results but does not save the results in memory to perform subsequent calculations with. How can I get the function to keep the result? Is there a way to assign the function output to a new variable before mathematica discards the results. Does this behavior have anything to do with the Head of the function being symbolic, rather than say a list?? Below is the relevant code: SetAttributes[ratio,Listable]; SetAttributes[intensity,Listable]; ratio[cy3_,cy5_]:=Table[Log[2,(cy3/cy5)]]//N; intensity[cy3_,cy5_]:=Table[Log[2,(cy3*cy5)]]//N; ratio[Table[fmicroarray[[i,18]],{i,1,Length[fmicroarray]}], Table[fmicroarray[[i,19]],{i,1,Length[fmicroarray]}]] I appreciate any insight you might have. Thanks. Todd