hi everyone! Thank you so much for attempting to help me!
The question may be a little unclear. Let me explain.
I have two matrixes, both are a 3x3. I also have 1 other matrix--a 1x2 and called 'indices'. The 1x2 matrix will represent the the index of both 3x3 matrixes. For example, [2 2 ] means I want to find the number located in postion 2,2 on both matrixes. [3 3], number in position 3,3 on both matrixes, etc
Now, I want to use an if statement to ensure the 1x2 matrix is within bounds of the 3x3 matrix. I don't want the 1x2 matrix, for example, to be [4 4] because I can't find the number in position 4,4 on both 3x3 matrixes. I also don't want the 1x2 matrix to be [0 0] because matlab begins indexing at 1. I know that negative indexing exists in matlab, but my class has not hit on this topic yet. Thus, don't worry about negative indexing. The 1x2 matrix will never contain any negative numbers. If indices is outside of bounds, I want to display ''Error: index is out of bounds.'
So far I have:
But I am not getting it right. The computer spits out it's own error, not my personalized ''Error: index is out of bounds.'