I have two Array{Float32,2} variables, X1 and X2. Both are 5 by 949.
In the REPL, this works:
Julia> X2\X1
949x949 Array{Float32,2}:
<lots of stuff>
which is what I expect and want.
but doing the exact same operation inside a function:
function mydiv(X1,X2)
K=X2\X1
end
gives
ERROR: DimensionMismatch("second dimension of A, 949, does not match length of x, 5")
Stacktrace:
[1] gemv!(::Array{Float32,1}, ::Char, ::Array{Float32,2}, ::Array{Float32,1}, ::Bool, ::Bool) at /build/julia-98cBbp/julia-1.4.1+dfsg/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:456
[2] mul! at /build/julia-98cBbp/julia-1.4.1+dfsg/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:66 [inlined]
[3] mul! at /build/julia-98cBbp/julia-1.4.1+dfsg/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:208 [inlined]
[4] *(::Array{Float32,2}, ::Array{Float32,1}) at /build/julia-98cBbp/julia-1.4.1+dfsg/usr/share/julia/stdlib/v1.4/LinearAlgebra/src/matmul.jl:47
What am I doing wrong here?