how to create a grid of half-integer
Show older comments
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)/2
end
end
Of course there is an error
Attempted to access u(1.5,2); index must be a positive integer or logical.
Accepted Answer
More Answers (0)
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!