Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong type called in example.ipynb #17

Closed
gnunziante4 opened this issue Dec 19, 2023 · 3 comments
Closed

Wrong type called in example.ipynb #17

gnunziante4 opened this issue Dec 19, 2023 · 3 comments

Comments

@gnunziante4
Copy link

gnunziante4 commented Dec 19, 2023

Hi,

I found in this line of example.ipynb

xai, = fourDVar(xi, Pi, ℳ, yo, R, H, nmax, no);

this error

ERROR: LoadError: MethodError: no method matching fourDVar(::Vector{Int64}, ::Matrix{Bool}, ::ModelMatrix{Matrix{Float64}}, ::Matrix{Float64}, ::Matrix{Float64}, ::Matrix{Int64}, ::Int64, ::StepRange{Int64, Int64})

You might have used a 2d row vector where a 1d column vector was required.
Note the difference between 1d column vector [1,2,3] and 2d row vector [1 2 3].
You can convert to a column vector with the vec() function.

Closest candidates are:
  fourDVar(::AbstractVector, ::Any, ::Any, **::AbstractVector**, **::AbstractVector**, ::Any, ::Any, ::Any; innerloops, outerloops, tol)

in particular yo and R are defined as AbstractVector in fourDVar function defined in fourDVar.jl
while in example.ipynb they are defined as Matrix{Float64}

m=1;

R = 0.1 * Matrix(I, m, m)

no = 10:5:nmax
yo = randn(m, length(no))

Thank you in advance for your support!

Alexander-Barth added a commit that referenced this issue Dec 19, 2023
@Alexander-Barth
Copy link
Owner

Thank you for letting me know! I just update the example.ipynb. Does it also work for you now?

@gnunziante4
Copy link
Author

Thank you for letting me know! I just update the example.ipynb. Does it also work for you now?

It perfectly works! Thank you

@Alexander-Barth
Copy link
Owner

Thanks for checking and your time to provide the feed-back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants