Thanks so much Mauro.  That does it.

On Monday, October 10, 2016 at 10:58:30 PM UTC+8, Mauro wrote:
>
> Try 
>
> for fl in fieldnames(myt) 
>    push!(getfield(myt,fl), 0.) 
> end 
>
> `fieldnames` returns the name of the field as a symbol, thus your error. 
>
> On Mon, 2016-10-10 at 16:41, K leo <[email protected] <javascript:>> 
> wrote: 
> > I hope to expand all arrays in a type using something like the 
> following: 
> > 
> > fields=fieldnames(myType) 
> >> for i=1:length(fields) 
> >>     push!(fields[i], 0.) 
> >> end 
> > 
> > 
> > But I get error saying no method matching push!(::Symbol, ::Float64) 
> > 
> > What else can I do for my purpose? 
>

Reply via email to