how to apply a list of functions (or commands) to a list of data
Answered
I am trying to implement an algorithm that has 3 functions running in parallel, each step depending on the previous state of the 3 functions together.
I can implement it manually by creating a tool having these 3 functions inside, and then by clicking on the tool and inputs as many times as iterations I want (or by typing it).
But I want this process to be done automatically, without clicking (which can generate errors, and take time).
It is possible to place functions in a list:
f(a,b)=a+b
g(a,b)=a-2b
h(a,b)=2a+3b
flist={f,g,h}
and then it is possible to do:
function=flist(2)
function(3,2)
-1
but I am not able to do:
flist(2) (3,2)
I am also not able to use zip.
Is there a turnaround?
try zip(w(3,2),w,flist)
I advice you to use function (x,y)
Hi lohabithi!
Does this command work for you?
I think it is only available in CAS.
Kind regards
mire2
try zip(w(3,2),w,flist)
I advice you to use function (x,y)
mathmagic: That is truly beautiful! Thank you.
Comments have been locked on this page!