Can someone help me with my code? I am trying to generate a lattice of harmonic oscillators, and I have written the following algorithm:
for n = 2:((N-1)/h)
a(1,n) = -(x0-(x(2,n)-x(1,n)));
x(1,n+1) = 2*x(1,n) -x(1,n-1) + (h^2)*a(1,n);
t(1,n+1) = t(1,n) + (h);
for i =...