Simulation in Matlab running too slow
Mostrar comentarios más antiguos
My simulation in matlab is running too slow because it is asking me to preallocate. The problem is that I do not know the dimension of the matrix because I do not know how many iterations will require (and requires a lot). What can I do? Also, if someone knows how to keep instead of whole matrix only the last two values and updating in each iteration, due to I am using double integrator in my loop. Thanks!
7 comentarios
per isakson
el 4 de Ag. de 2018
Walter Roberson
el 4 de Ag. de 2018
How does this question differ from https://www.mathworks.com/matlabcentral/answers/413431-matlab-is-running-too-slow#comment_596397 ?
Alba Cuevas
el 4 de Ag. de 2018
KALYAN ACHARJYA
el 4 de Ag. de 2018
Do not post the multiple questions, if your question having sufficient information and relevant, definitely you will get the answer.
Now the question part, remove the loops by using other alternatives method.
Alba Cuevas
el 4 de Ag. de 2018
Walter Roberson
el 5 de Ag. de 2018
I see the other question is gone now. But if I recall correctly, the original version had code for us to look at. When there is no code for us to look at, we can only reply in generalities, such as per's reference to Non-deterministic pre-allocation.
Alba Cuevas
el 5 de Ag. de 2018
Respuestas (0)
Categorías
Más información sobre Creating and Concatenating Matrices en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!