[Maxima] output multiple numbers on the same line

Stavros Macrakis macrakis at alum.mit.edu
Wed Dec 16 13:11:55 CST 2009


I don't believe there's any standard way to do exactly what you want.

A close approximation would be to use 'matrix', e.g.

     apply('matrix,makelist(makelist(f(i*0.05),i,1,4),f,[fa,fb,fc,fd]))

This arranges the results in neat rows and columns, but *centers* numbers
rather than aligning the decimal points.

I suppose you could change that by preformatting the numbers, e.g.

     apply('matrix,makelist(makelist(
?format(false,"~8,5f",f(i*0.05)),i,1,4),f,[fa,fb,fc,fd]))

where ?format is the Common Lisp format function.

           -s

On Wed, Dec 16, 2009 at 1:25 PM, Michael Anderl <michael.anderl at gmail.com>wrote:

> Hi,
> is it possible to get an output like a table.
>
> e.g.: I have 4 functions fa(x), fb(x), fc(x), fd(x)
>
> now i want an output like
>
> fa(0.05)            fb(0.05)               fc(0.05)             fd(0.05)
> fa(0.10)            fb(0.10)               fc(0.10)             fd(0.10)
> fa(0.15)            fb(0.15)               fc(0.15)             fd(0.15)
> fa(0.20)            fb(0.20)               fc(0.20)             fd(0.20)
>
> the comma should be in a vertical line.
>
> it would be possible to do it with
>
> for m:1 thru 4 do print(" " ,float(fa(0.05*m)), " " ,
> float(fb(0.05*m)) , " " , float(fc(0.05*m)), " " , float(fd(0.05*m)))$
>
> but then i dont have the results in a vertical line.
>
> is there some function to do this?
> thx
> mike
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.math.utexas.edu/pipermail/maxima/attachments/20091216/160ed958/attachment.htm 


More information about the Maxima mailing list