The Math Forum

Search All of the Math Forum:

Views expressed in these public forums are not endorsed by NCTM or The Math Forum.

Math Forum » Discussions » Software » comp.soft-sys.matlab

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

Topic: Index out of bounds error
Replies: 4   Last Post: Feb 6, 2013 2:32 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]

Posts: 9,850
Registered: 6/7/07
Re: Index out of bounds error
Posted: Feb 6, 2013 9:10 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2/6/2013 12:02 AM, Nicholas wrote:
> 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.

You must have modified it somewhere then...set a breakpoint at the point
after it's been entered and then step and see where it's modified. Or,
put in some strategic disp() statements and/or remove trailing ';' to
have output echo'ed to the console to see where things go south.

Check it's what you're actually running that you think it is...try

which (your_script/function_name)

at the command line to be certain it's not an aliased copy accidentally
saved earlier. If you've modified it, be sure you're running the
modified copy to be sure you've saved and in proper subdirectory and then

clear (your_script/function_name)

to make the new version be loaded instead of, perhaps a cached old
version still in memory...


Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.