One way would be

a = DB([],[])
a.Y=rand(Complex{Float64},100)
a.W=rand(Float64,100)

or just

b = DB(rand(Complex{Float64},100),rand(100))

Kaj



On Sunday, July 26, 2015 at 8:44:14 AM UTC+3, Joe Tusek wrote:
>
> Tom thanks, sorry to be asking such basic questions, I have access to the 
> reference manual but can't get enough out of it to see what the correct 
> syntax is. I settled on trying just some simple code as below that 
> was making a structure DB and then trying to make an array of 100 elements 
> with that  structure 
>
> type DB
>   Y::Vector{Complex128}
>   W::Vector{Float64}
> end
>
> y = Array(Complex128,100)
> w = Array(Float64,100)
>
> data = Array(DB,100)     # making an array of 100 elements of type DB
>
> data[10].Y = 2.0+3.0im   # this results in an getindex error as there is 
> no method to support the assignment. 
>
> Can someone advise the correct syntax for making data an array with 100 
> elements of type DB and filling it with vectors instead of iterating 
> through the assignment of the elements?
>
>
>>>  

Reply via email to