On Monday, May 26, 2014 08:13:21 PM yi lu wrote:
> OK, I understand. I think storing data into memory will be fine for me.
>
> I do read the *Multi-dimensional Arrays *part*, *and find the assignment
> part not so familiar.
Aside from the use of [] rather than (), assignment is almost exactly like in
Matlab. The main practical difference is that in Julia it's very efficient to
write loops and directly address elements as u[xi, yi, ti].
> This is because I use MATLAB before and I often do
> some code like
> a=[a,b]
> which may be very slow in fact(I am not so sure).
Right. While in Matlab there isn't a great alternative, for growing 1d arrays
Julia has push! and append! which are vastly more efficient. For various
(important) reasons, that doesn't work with a multidimensional array. However,
even in 1d the fastest of all is to pre-allocate your storage and address each
element directly, and that also works in 3d.