Suggestion for EXECON.
|
12-17-2014, 12:51 PM
(This post was last modified: 12-17-2014 01:06 PM by Snorre.)
Post: #21
|
|||
|
|||
RE: Sugdestion for EXECON.
(12-17-2014 06:54 AM)parisse Wrote: Yes, EXECON is more versatile. zip and apply work for 2 or 1 arg function. Otherwise just write a loop yourself if you need it in the CAS. Hey, that sounds like a nice challenge. My first purely(?) functional solution is (indentation+linebreaks for readability): Code: napply(fn, lsts):= Usage: a:={a1,a2,a3,a4}, b:={b1,b2,b3}, c:={c1,c2,c3,c4,c5} abc:={a,b,c} g(x,y,z):=x+y+z napply(g,abc) returns the sequence a1+b1+c1, a2+b2+c2, a3+b3+c3 which could be made into a vector by putting brackets or a list by putting braces around it, e.g. {napply(g,abc)}. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)