Close :)

You can try:

julia> x = [Matrix() for i=1:5]
5-element Array{Array{Any,2},1}:
 0x0 Array{Any,2}
 0x0 Array{Any,2}
 0x0 Array{Any,2}
 0x0 Array{Any,2}
 0x0 Array{Any,2}

Also:

julia> x = [rand(i,i) for i=1:5]
5-element Array{Array{Float64,2},1}:
 1x1 Array{Float64,2}:
 0.518641                                                                   
                                                                            
                                                                            
            
 2x2 Array{Float64,2}:
 0.219756  0.753237
 0.294669  0.718687                                                         
                                                                            
        

 3x3 Array{Float64,2}:
 0.951481  0.114902  0.632999
 0.934798  0.528655  0.759751
 0.695776  0.013846  0.568784                                               
                                                                            
        

 4x4 Array{Float64,2}:
 0.0338033  0.999119  0.914414  0.114614
 0.947484   0.16535   0.512054  0.115579
 0.135501   0.317845  0.832064  0.16373
 0.365693   0.879762  0.313289  0.0339317                                   
    

 5x5 Array{Float64,2}:
 0.181271   0.68545   0.749937   0.116528  0.193043
 0.545848   0.787693  0.793377   0.405328  0.797003
 0.0121521  0.476136  0.0411077  0.200597  0.496779
 0.50343    0.32037   0.455482   0.260218  0.308114
 0.855837   0.471426  0.723162   0.591161  0.128503



On Sunday, December 6, 2015 at 10:21:13 AM UTC+8, Lex wrote:
>
> Hi 
>
> I am not sure how to create an array of fixed size which may store 
> matrices of different dimensions for later applying algebraic operations. 
> Any help is appreciated.
> Some of the things I tried:
>
> x = [Matrix{} for i=1:5]
>
>
> x = [Any for i=1:5]
> for i in 1:5
>   x[i] = Any
> end
>
>
>
>
>

Reply via email to