LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do i implement boundary condition to a 3d array?

i'm using a matalb script and trying to implement a boundary condition into my 3d array...i have already completed the arrays using labview but am not sure how to set the conditions. part of the code is as follows: 

 

u(1,:,n+1) = u(2,:,n+1) ;
u(length(x),:,n+1) = u(ni-1,:,n+1) ;
u(:,1,n+1) = -u(:,2,n+1) ;
u(:,length(y),n+1) = -u(:,nj-1,n+1) ;

 

many thanks 

 

0 Kudos
Message 1 of 6
(2,877 Views)

Use Index Array and Replace Array Subset.  Also, keep in mind that LV array indexes start at 0 and go to length - 1 unlike Matlab.

 

Lynn

0 Kudos
Message 2 of 6
(2,875 Views)

but how would i equate them? would it be possible to get a simple example? 

 

many thanks 

0 Kudos
Message 3 of 6
(2,873 Views)

Here is a simple brute force 2D example.  It could also be done in a loop with a shift register and a case structure.  That method would be easier to expand to multiple dimensions.

 

In looking back at your Matlab code, I think I swapped things in the reverse order. You can switch index inputs on Index Array and Replace Array Subset to get the order you need.  I did not look at the corners.  My code fills boundary rows first.  This may not put the value you want in the corners.

 

Lynn

0 Kudos
Message 4 of 6
(2,864 Views)

How can i set somethin to equal a negative array?

0 Kudos
Message 5 of 6
(2,840 Views)

I do not understand that question.  Can you post an example of what you are trying to do?  Include some typical data and show what the output should be.

 

Lynn

0 Kudos
Message 6 of 6
(2,833 Views)