I would like to create a list of compiled functions and then plot them 1 by 1. To illustrate the problem (In reality the functions I want to compile are of course not x^j but some complicated matrices):
cf = Table[Compile[{{x, _Real}}, x^j], {j, 1, 3}]
as output I get a list of compiled functions. Then I would like to plot one of them, for example the second:
Plot[cf[[2]][x], {x, -1, 1}]
During evaluation of In[107]:= CompiledFunction::cfse: Compiled expression j should be a machine-size integer. >>
During evaluation of In[107]:= CompiledFunction::cfex: Could not complete external evaluation at instruction 1; proceeding with uncompiled evaluation. >>
This is a bit weird since if I compile all those functions independently (without the use of a table around Compile) I can plot them nicely.
I hope this is not just a stupid syntax error, I am quite new to mathematica so please excuse me my probably stupid question :)
Luke