please tell me...m solving an optimization problem with inequality
constraints. The error m getting while running my code is : "error: x(15):
out of bound 1"
please let me know...what is the error and how to resolve this.
--
Sent from: http://octave.1599824.n4.nabble.com/Octave-General-f1599825.html
Hi Satyaballi,
Out of bounds errors occur when you're trying to access a vector with an index that is larger than its length. For example,
>> x = zeros(1,10);
>> x(12)
error: x(12): out of bound 10
>>
So, from the error you gave, on line 44 of the g function, the vector x (which has size 1) is trying to be accessed by an index of 15. Usually in these cases, if I can't figure out why this is happening, I either put a breakpoint at that line and see what the value of the offending vector (or index) or place an if/endif statement to check to see if the size of x is 1 (in this case) since you obviously are assuming that it is longer than that.
Hope this helps,
James Sherman Jr.