Campbell Ritchie wrote:Welcome to the Ranch
Why are you reassigning the two parameters? Are you sure you want to assign to the n‑th index of the array? Shouldn't any assignments be inside the loop? Why k+1 rather than k?
I never realised that. Thank you. You may not need the parameter k because you have two arrays each with a .length field. I think you can probably use that .length field instead.
James Russel wrote:. . . because the result of the two arrays . . . would be one longer than the original arrays . . .
James Russel wrote:
James Russel wrote:k is the number of iterations you want. If you give it 2 initial conditions and want a sequence of k=5 values, it will compute from xk to xk since it knows xk=x0 and xk=x1...