how can i prelocate arrays

1 visualización (últimos 30 días)
Nihar  Patel
Nihar Patel el 18 de Sept. de 2019
Respondida: SaiDileep Kola el 23 de Sept. de 2019
  2 comentarios
James Tursa
James Tursa el 19 de Sept. de 2019
Editada: James Tursa el 19 de Sept. de 2019
Please edit your question and post your code as text formatted with the CODE button. We cannot copy & paste pictures into MATLAB to try out your code. My guess is that u is a variable and not a function, so using t(i) in the indexing may be the cause of the problem.
John D'Errico
John D'Errico el 19 de Sept. de 2019
Yes. I think you are correct. The obvious problem is if u is a variable, are the terms like (u(t(i) + pi)). t(i) + pi will never be an exact integer.

Iniciar sesión para comentar.

Respuestas (1)

SaiDileep Kola
SaiDileep Kola el 23 de Sept. de 2019
Pre allocating arrays may not solve your problem, as the error msg states you are indexing array ”u” using either negative integers or fractions, check if “t(i)-3” value turns out to be a negative or fraction.

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