index in position 1 exceeds array bounds. index must not exceed 1. error in toolkette_new>getsammlerdaten (line 29) if strcmp(table{1,j}, fahrzeuge(j).fahrzeug_id(j,1)) ~= 1 in matlab

The error message is saying that the index used to access an array is greater than the maximum index for that array in MATLAB. You cannot index an array element that is beyond its bounds.

In the provided code, the problem is likely occurring in the getsammlerdaten function on line 29, where the strcmp function is being used to compare the values in table{1,j} to fahrzeuge(j).fahrzeug_id(j,1).

To fix this error, you need to make sure that the indices used to access the array elements in table and fahrzeuge are within their allowable ranges. You could do this by checking the sizes of these arrays and adjusting the index values accordingly.

main.m
% Example of accessing an array element beyond its bounds
array = [1, 2, 3];
index = 4;
value = array(index); % This will result in an "Index exceeds matrix dimensions" error

% Example of accessing an array element within its bounds
array = [1, 2, 3];
index = 2;
value = array(index); % This will return the value "2" from the array
334 chars
10 lines

gistlibby LogSnag