Index exceeds the number of array elements (40)

6 visualizaciones (últimos 30 días)
Aiman Faruq
Aiman Faruq el 21 de Oct. de 2021
Respondida: Cris LaPierre el 22 de Oct. de 2021
fname={'Data1_211021-114355.CSV','Data2_211021-114519.CSV','Data4_211021-114632.CSV','Data6_211021-115350.CSV','Data7_211021-115745.CSV'};
ii= 1
[data,time] = gl2000_csvread(fname{ii});

Respuestas (1)

Cris LaPierre
Cris LaPierre el 22 de Oct. de 2021
Missing a lot of details here, but the error is easy enough to interpret. You are trying to access an element that does not exist in your array. Specificaly your array has 40 elements, and you have tried to index it with a number greater than 40.
A = 1:5;
% Works
A(3)
ans = 3
% Doesn't work
A(10)
Index exceeds the number of array elements. Index must not exceed 5.

Categorías

Más información sobre Matrices and Arrays en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by