As you probably realized vcat makes a copy of the vector, so it is 
inefficient when you use it repeatedly. Julia provides the push! and append! 
functions 
so that you can efficiently add elements to the end of a vector. There is 
also a sizehint! function if you know how many elements there will 
ultimately be, and want to save a few copies when the array grows. 

søndag 1. februar 2015 15.31.40 UTC+1 skrev Christopher Fisher følgende:
>
> Hi all-
>
> I am trying to figure out a graceful way to store output from a model 
> simulation. Each simulated trial produces a single reaction time, a single 
> choice and a vector of visual fixations generated by a Markov chain. The 
> complicating factor is that the size of the vector of visual fixations 
> varies on each simulated trial and I would like to generate multiple 
> simulated trials. Is there a way to store these outputs in a data structure 
> that will be easy to access in other functions?
>
> A related issue is the dynamic nature of the vector size. I am currently 
> using vcat to add new values to the vector. Is there a more efficient 
> method?
>
> Thank you in advance for your help.
>

Reply via email to