How to make an array of vectors and matrices in Julia

Viewed 197

I don't know how to make an array of vectors and matrices in Julia. For example, how I make a list p such that

p[1]=[1;2]
p[2]=[2 3; 4 5]

?

1 Answers

You can use an array of "Any"

p=Any[[1;2],[2 3; 4 5]]

which returns

2-element Array{Any,1}:
 [1, 2]
 [2 3; 4 5]
Related