In my code
mutable struct frame
Lx::Float64
Ly::Float64
T::Matrix{Float64} #I think the error is here
function frame(
Lx::Float64,
Ly::Float64,
T::Matrix{Float64}
)
return new(Lx, Ly, T)
end
end
frames = frame[]
push!(frames, frame(1.0, 1.0, undef)) #ERROR here I try nothing, undef, any
push!(frames, frame(2.0, 1.0, undef)) #ERROR here I try nothing, undef, any
frames[1].T = [1 1 2]
frames[2].T = [[2 4 5 6] [7 6 1 8]]
I got the following error in ::Matrix
ERROR: MethodError: no method matching frame(::Float64, ::Float64, ::UndefInitializer)
Closest candidates are:
frame(::Float64, ::Float64, ::Matrix)
I need to define the dimensionless matrix inside the structure and then pass the matrices with different dimensions, but I'm having an error when I push!