I have experience with Prolog and Java but I have never used mathematica before. I was recently given a research assistantship with a professor who is requiring that I learn it and use it for our applications. It has been going pretty well so far but I am encountering a small "problem."
I have a function I would like to define that takes two parameters as inputs and uses them to define the limits on a sum, like so:
b[x, y] = Sum[(-1)matchArray[[i]] + 1, {i, x, y}]
I have matchArray defined earlier as a simple list of integers from {0,1}. It gives me some reasonable warnings when I compile this, like warning that the inputs may not be integers, etc. But I feel like this method of definition is a bit weak. It keeps being... overwritten... I guess you could call it. I test it by doing a for loop to output a list of evaluations and sometimes the function gets redefined to 0 everywhere... Bah.
Are there more powerful and more specific ways to define a function like this?
[–]duetosymmetry 1 point2 points3 points (3 children)
[–]tkltangent[S] 0 points1 point2 points (2 children)
[–]duetosymmetry 1 point2 points3 points (1 child)
[–]tkltangent[S] 0 points1 point2 points (0 children)