wayna
wayna

Reputation: 71

How to make an array of vectors and matrices in Julia

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]

?

Upvotes: 3

Views: 480

Answers (1)

Picaud Vincent
Picaud Vincent

Reputation: 10982

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]

Upvotes: 3

Related Questions