Borrar filtros
Borrar filtros

Indexing Exceeds number of array elements

2 visualizaciones (últimos 30 días)
Muhammad Amir Javed
Muhammad Amir Javed el 28 de Feb. de 2023
Respondida: Image Analyst el 28 de Feb. de 2023
et=4; dn1=1:61;
for ii=length(dn1)
r(ii)=(et+((dn1(ii+1)-dn1(ii))))./((dn1(ii)-(dn1(ii-1)))+et);
end
Index exceeds the number of array elements. Index must not exceed 61.

Respuesta aceptada

Image Analyst
Image Analyst el 28 de Feb. de 2023
Look at your indexes - they go from ii-1 to ii+1 so ii can only go from 2 to length(dn)-1
et=4;
dn1=1:61;
for ii = 2 : length(dn1)-1
r(ii) = (et+((dn1(ii+1)-dn1(ii))))./((dn1(ii)-(dn1(ii-1)))+et);
end

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by