ok so I have created an embedded for loop and need to access certain elements in each dimension of a 3d array in order for it to be manipulated. My 3d array is called 'u'. Below is the code in matlab and attached is my attempt:
ni and nj =201
PLEASEEEE HELPPPPP!!!!
1: (length(t)-1)
for i=2: (ni-1)
for j=2: (nj-1)
u(i,j,n+1) = ((u(i+1,j,n) + u(i-1,j,n) + u(i,j+1,n) + u(i,j-1,n))/4)...
- 0.5*(dt/dx)*((u(i+1,j,n)^2)/2 - (u(i-1,j,n)^2)/2)...
- 0.5*(dt/dy)*(v(i,j,n))*(u(i,j+1,n) - u(i,j-1,n)) - 0.5*g*(dt/dx)*(h(i+1,j,n)-h(i-1,j,n));