Hello, help me please. To solve problems of the type "boundary layer" need to create a half-integer grid. x=x0+(i+1/2)*dx, i=0,1,2… where dx – step. Example
for i=1:n for j=1:m v(i+1/2,j+1)=v(i+1/2,j)+dy*((u(i+1,j)-u(i,j))/dx - (u(i+1,j+1)-u(i,j+1))/dx)/2endend
Of course there is an error
Attempted to access u(1.5,2); index must be a positive integer or logical.
Best Answer