[Maxima] use "for" loop to create list
maxima at etherjones.us
Tue Apr 3 10:35:01 CDT 2012
Thanks. That's a whole lot easier than the way I was trying to do it:
h[i,j] := i$
MX: genmatrix (h,n,1)$
k[i,j] := i^(j+1)$
MY: genmatrix (k,n,1)$
I still haven't figured out how to effectively search the Maxima help. If you don't know the word you're searching for (in this case "makelist"), sometimes it's hard to find what you need.
From: Richard Fateman <fateman at eecs.berkeley.edu>
To: Ether Jones <maxima at etherjones.us>
Sent: Tuesday, April 3, 2012 10:19 AM
Subject: Re: [Maxima] use "for" loop to create list
On 4/3/2012 7:09 AM, Ether Jones wrote:
How do I create this list:
or if you insist on a " for loop ',
for i:1 thru 10 do s:cons([i,i^2],s),
I had suggested (and, I think, implemented) a change to allow
mylist: for i:1 thru 10 collect [i,i^2];
but that somehow didn't happen.
The common lisp "loop" could be used as an inspiration for other
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Maxima