LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

selecting elements from 3d array

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));

0 Kudos
Message 1 of 2
(2,177 Views)

Duplicate Post

 

Why did you create a second message with the same question?

0 Kudos
Message 2 of 2
(2,174 Views)