How to store matrices as an element in a vector array?

I have 16 matrices with the size of 360x180. My goal is to store them in a cell array like in Matlab, i.e.,

A = [];
for i=1:16
A{i} = Matrix i;
end

I thought I could do the same thing in Julia as below:

A = [];
for i in 1:16
global A[i] = Matrix i;
end

Unfortunately, I got the below error:
LoadError: BoundsError: attempt to access 0-element Vector{Any} at index [1]

use push!

3 Likes

Works like a charm!

Many thanks.