How do I create a function of a list, such that if any member of the list is negative it is zero, otherwise it follows a recursion relation.
Mathematically this is what I have to do, but I’m not sure how to do it in Mathematica.
Thanks.
Edit: To be completely precise, I am trying to implement the recursion relation on page 6 of this paper (eq 18):
http://arxiv.org/PS_cache/nlin/pdf/0003/0003069v1.pdf
However, it’s quite complicated and requires a fair amount of reading to understand, so I didn’t want to bring it into the question!
Testing if any member of a list satisfies some condition can be done using MemberQ. To test if the list
lstcontains any element less than zero,The second argument here is a conditional pattern.
But yes, knowing what it is you want to do would help.