Hey, I have defined(adsbygoogle = window.adsbygoogle || []).push({});

and written the loop:Code (Text):pu = zeros(nx,ny,N);

pv = zeros(nx,ny,N);

pu(:,ny,:) = 1;

line 38-40

and I get the errorCode (Text):for i = 2:(nx-1);

for i = 2:(ny-1);

ps(i,j) = p(i,j,n) - a1*(pu(i+1,j,n) - pu(i,j,n)) -a2*(pv(i,j+1,n) - pv(i,j,n));

Could someone help me with the error? ??? Attempted to access pv(2,11,1); index out of bounds because size(pv)=[10,10,10].

Error in ==> fluidmekanikk at 40

ps(i,j) = p(i,j,n) - a1*(pu(i+1,j,n) - pu(i,j,n)) -a2*(pv(i,j+1,n) - pv(i,j,n));

**Physics Forums - The Fusion of Science and Community**

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Matlab: out of bounds.

Loading...

Similar Threads - Matlab bounds | Date |
---|---|

How to program this in Matlab | Feb 28, 2018 |

Matlab Making a short test for self-adjointness | Feb 23, 2018 |

Embedded Matlab Array Bounds Error | Oct 6, 2008 |

Matlab problem - index out of bounds because numel(temp3)=0 | Jan 29, 2007 |

**Physics Forums - The Fusion of Science and Community**