From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(1,899 Views)

Duplicate Post

 

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

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