Borrar filtros
Borrar filtros

Info

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

How can I solve this problem ?

1 visualización (últimos 30 días)
Giuseppe Napoli
Giuseppe Napoli el 28 de Feb. de 2017
Cerrada: MATLAB Answer Bot el 20 de Ag. de 2021
Hello to everyone. I need help with the attached code. Why Matlab tell me : " Index exceeds matrix dimensions. Error in Texture_tris (line 186) , phi2A(j+1) = phi2A(j+1) + dnA; "
I wrote some other programs with the same script and that one never gave me an error? How this can be possible ? Thanks in advance.
  1 comentario
Adam
Adam el 28 de Feb. de 2017
Use
dbstop if error
and just look on command line at the size of the array and the index you are giving to it and you will find the problem. Just looking at a mass of code it is very difficult for us to pinpoint this error. Debugging is the way to do this - the error message is very clear as to what the problem is. What the cause of it is you would know best once you find the problem since it is your code.

Respuestas (2)

Jan
Jan el 28 de Feb. de 2017
The error message means, that "phi2A(j+1)" tries to access a not existing element. For the current value of j, there is no j+1 'th element. Use the debugger as mentioned by Adam to examine the problem.

Star Strider
Star Strider el 28 de Feb. de 2017
One possible solution is to change the for call from:
for j = 2 : ncA
to:
for j = 2 : ncA-1

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