Borrar filtros
Borrar filtros

Solve error : Index in position 2 exceeds array bounds. Index must not exceed 15.

2 visualizaciones (últimos 30 días)
a=2;
m=5;
n=15;
%ADM is matrix of size 5by15
for i=1:m
for k=1:3
B(i,k)=0;
for j=1:n/3
B(i,k)=ADM(i,3*j-a)+B(i,k);
end
a=a-1;
end
end
  2 comentarios
DGM
DGM el 1 de Oct. de 2022
ADM is 5x15.
You're trying to access ADM(i,3*j-a) when j = 5 and a = -1. 3*j-a = 16.
How to resolve this depends entirely on what the code is intended to do.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Matrix Indexing 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