create a statement conditional on if index is in bounds

9 views (last 30 days)
lets say A is a matrix [4 2 3 1 5 0]. during a while loop with j=j+1 on each loop, I would like to say if A(j) is out of bounds then the program needs to break the while loop. If you have any questions let me know. Thanks for your help!
  1 Comment
Walter Roberson
Walter Roberson on 23 Jan 2013
Edited: Walter Roberson on 23 Jan 2013
A(j) is out of bounds with respect to what? Some other matrix? Or are you asking about whether j is out of bounds with respect to indexing A ?

Sign in to comment.

Answers (0)

Categories

Find more on Creating and Concatenating Matrices in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!