On Tue, 13 Oct 2009 at 10:04PM -0700, Andrew.algebra wrote: > Hi there, I've only just started using sage and I'm still very much > the beginner. > > I'd like to be able to evaluate a number of functions, and have their > output display as a tuple. > > To be more specific, I have 24 functions, each of the same 4 > variables. I can define a matrix with function entries, but I can't > seem to evaluate it as the Matrix object has no attribute "function". > > Ideally, I'd like to enter > > f(a,b,c,d) > > and the answer to appear as > > (g_1(a,b,c,d) g_2(a,b,c,d) ... g_24(a,b,c,d))
How about something like (not tested): def f(*args): return tuple(func(*args) for func in [g1, g2, g3...g24]) If your functions really are called "g1", "g13", and so on, you'll need to write in the full list above. Dan -- --- Dan Drake ----- http://mathsci.kaist.ac.kr/~drake -------
signature.asc
Description: Digital signature