preallocating an array changes the plot that it draws values from?

I am trying to create a plot based off matrix values within a loop. Basically the matrix is extremely large (on the order of over millions of values) and is going to create a value based on if statements. Pre allocation has reduced the function run time from 560 seconds to about 3. The issue is that the plot that is drawing values from the matrix is coming out differently if I preallocate or not, even though other printed variable values from the matrix are coming out the same. Anyone have any idea why this might be occurring?

Answers (0)

Asked:

on 13 Sep 2018

Commented:

on 13 Sep 2018

Community Treasure Hunt

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

Start Hunting!