Clear Filters
Clear Filters

simulation takes hours to run. ''variable appears to change size on every loop iteration( within a script). how do I preallocate for speed please?

1 view (last 30 days)
simulation takes hours to run. It says ''variable appears to change size on every loop iteration( within a script). how do I preallocate for speed please? Thanks

Accepted Answer

Torsten
Torsten on 30 Apr 2023
Moved: Torsten on 30 Apr 2023
Preallocate it with the largest possible size. But if the simulation takes hours, I doubt the missing preallocation is the bottleneck.

More Answers (0)

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!