MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi
Learn moreOpportunities for recent engineering grads.
Apply TodayNew to MATLAB?
MATLAB Central > MATLAB Newsreader > Index out of bounds error 

I was curious if you could figure out why I am getting an index out of bounds error. My code is a finite difference formulation using the crank nicolson method. 
"Nicholas " <nsbakes2@gmail.com> wrote in message <kertor$pv$1@newscl01ah.mathworks.com>... 
On 2/5/2013 3:32 PM, Nicholas wrote: 
I'm extremely new to programming and have virtually no experience with matlab. I've tried going through the debug mode with no luck. The b variable is the matrix "b" in Ax =b. A is the tridiagonal matrix. My code is telling me Nx =50 when it runs even though I'm specifying 51 as the input. 
I'm extremely new to programming and have very limited experience in matlab. I've gone through the debug mode with no luck. It doesn't make sense that, even though I'm inputting 51 as the number of nodes, my code is telling me Nx = 50. 
On 2/6/2013 12:02 AM, Nicholas wrote: 
On 2/6/2013 12:02 AM, Nicholas wrote: 
Thanks for the suggestions. The probelm ended up being that the upper and lower diagonals defined in the tridiagonal matrix solver were missing an element. 
No tags are associated with this thread.
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.