Borrar filtros
Borrar filtros

Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Error in my matlab program regarding value of an index. Help.

1 visualización (últimos 30 días)
Virajan Verma
Virajan Verma el 15 de Oct. de 2018
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
for i=1:9
N_matrix(1,i)=N(rem(i,3))*ex(i/3);(ERROR HERE)
end
Attempted to access ex(0.333333); index must be a positive integer or logical.
Error in practisee3 (line 9) N_matrix(1,i)=N(rem(i,3))*ex(i/3);
  8 comentarios
Dennis
Dennis el 15 de Oct. de 2018
Editada: Dennis el 15 de Oct. de 2018
This actually shows that ex is not a function, but a matrix. Matrix indices need to be positive integer (1,2,3,4,5). ex(1/3) does not exist.
Kevin Chng
Kevin Chng el 15 de Oct. de 2018
Editada: Kevin Chng el 15 de Oct. de 2018
why do you want to do i/3 for ex if it is a matrix? because 1/3 won't be 1 for your first iteration.

Respuestas (0)

La pregunta está cerrada.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by