On Tue, Jun 9, 2015 at 11:27 AM, Michela Di Lullo <[email protected]> wrote: > The problem is for attribute pt_l::Float64 > > that is a matrix (of float values) of dimension size(generators,1). > I guess I've to say somehow that pt_l is a matrix... while node, a, ..., > toff are vectors.
>From the output, it seems that neither the type declaration nor the value you passed in is a matrix. It might be more helpful to post your full program here. > > > > Il giorno martedì 9 giugno 2015 17:14:33 UTC+2, Tom Breloff ha scritto: >> >> I think you want to create a constructor: >> TUnit(node::Float64,a::Float64,...,toff0::Float64) = >> TUnit(round(Int16,node),a,...,toff0) >> >> >> >> On Tuesday, June 9, 2015 at 10:50:06 AM UTC-4, Michela Di Lullo wrote: >>> >>> My type is: >>> >>> immutable TUnit >>> Node::Int16 >>> a::Float64 >>> b::Float64 >>> c::Float64 >>> inf::Float64 >>> sup::Float64 >>> ton::Int16 >>> toff::Int16 >>> storia0::Int16 >>> pt0::Float64 >>> rampa_up::Float64 >>> rampa_dwn::Float64 >>> rampa_up_str::Float64 >>> rampa_dwn_str::Float64 >>> SUC_C::Float64 >>> tau_max::Int16 >>> pt_l::Float64 >>> storia0UP::Float64 >>> storia0DW::Float64 >>> u0::Float64 >>> ton0::Float64 >>> toff0::Float64 >>> end >>> >>> Then I have: >>> >>> TUnitS = Array(TUnit,size(generators,1)) >>> >>> for j in 1:size(generators,1) >>> TUnitS[j] = TUnit(generators[j,1:end]...) >>> end >>> >>> Now, pt_l is a matrix of float numbers, and so I get >>> >>> ERROR: `TUnit` has no method matching TUnit(::Float64, ::Float64, >>> ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, >>> ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, >>> ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, ::Float64, >>> ::Float64, ::Float64, ::Int64, ::Int16, ::Int16) >>> >>> How can I declare it properly?
