Octave "error: index out of bound" in CI
Octave indexed past the end of an array. In CI the array is often smaller than locally because a different fixture, an empty result, or a shorter dataset changed its length.
What this error means
A run stops with "error: data(4): out of bound 3 (dimensions are 1x3)" at a subscript that assumed a fixed size.
Octave
error: data(4): out of bound 3 (dimensions are 1x3)
error: called from
report at line 6 column 5Common causes
The array is shorter than the code assumes
A hardcoded index fails when CI produced fewer elements from different input.
An empty result from an earlier step
A filter or query returned empty on the runner, so any positive index is out of bounds.
How to fix it
Guard against the real length
- Check
numel(data)before indexing. - Handle the empty or short case explicitly.
- Reproduce with the CI fixture to confirm the size difference.
report.m
assert(numel(data) >= 4, 'expected >=4 samples, got %d', numel(data));
v = data(4);Align fixtures between local and CI
Use identical input data in both places so array sizes match.
How to prevent it
- Validate array lengths before fixed-index access.
- Handle empty results explicitly.
- Keep fixtures identical across local and CI runs.
Related guides
Octave "error: 'X' undefined" in CIFix Octave "error: 'X' undefined" in CI - the name is not on the Octave path (addpath missing), belongs to an…
Octave "error: assert" test failure in CIFix Octave "error: assert" test failures in CI - an assert in a test or oct-test block failed, and you must m…
Octave "parse error" in CIFix Octave "parse error" in CI - a syntax construct Octave rejects, often MATLAB syntax that Octave does not…