Index out of range

I am trying to run some code on my data.  GAUSS reports the error message below.

error G0058 : Index out of range

Does anyone know what this means?

Thank you!

1 Answer



0



Index out of range means that the code is trying to access a matrix or vector outside of its bounds. For example:

x = rndn(5, 1);
y = x[6, 1];

would cause this error, because it is trying to access the 6th element out of a total of 5. This can also happen if the value you using as an index is an Infinity, Nan or missing value. For example:

idx = 1/0;
x = ones(5, 1);
y = x[idx];

would also return this error.

Your Answer

1 Answer

0

Index out of range means that the code is trying to access a matrix or vector outside of its bounds. For example:

x = rndn(5, 1);
y = x[6, 1];

would cause this error, because it is trying to access the 6th element out of a total of 5. This can also happen if the value you using as an index is an Infinity, Nan or missing value. For example:

idx = 1/0;
x = ones(5, 1);
y = x[idx];

would also return this error.


You must login to post answers.

Have a Specific Question?

Get a real answer from a real person

Need Support?

Get help from our friendly experts.

Try GAUSS for 14 days for FREE

See what GAUSS can do for your data

© Aptech Systems, Inc. All rights reserved.

Privacy Policy