Index is out of range when creating 3D arrray
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
This is a part of program code for reading csv file and creating 3D array.
But when runnig the code , the error "Index is out of range" occurs.
How is this code modified?
Providing supplementary information about this code, NUM_data = 40
list = dir(path);
list={list.name};
list = natsortfiles(list);
list = string(list);
for n = 1:length(NUM_data)
list(n);
X(:,:,n) = dlmread(list(n));
end
X_three_way = permute(X,[3 2 1]);
sample = X_three_way;
0 comentarios
Respuestas (1)
Sulaymon Eshkabilov
el 19 de Oct. de 2021
If NUM_data = 40, then your code should sth like this one:
...
for n = 1:NUM_data
X(:,:,n) = dlmread(list(n));
end
...
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!