MATLAB.jl icon indicating copy to clipboard operation
MATLAB.jl copied to clipboard

Fails to put large variables to the Matlab engine

Open stelmo opened this issue 8 years ago • 3 comments

Hi, I wrote a small script that uses Matlab's nnmf function to factorize a large matrix (~5000 rows by 60000 columns). I generate the matrix, called V, in Julia and I use the following code to call the function: w, h, rss = mxcall(:nnmf, 3, V, 2)

Unfortunately this generates the error:

ERROR: MATLAB.MEngineError("failed to put variable jx_nnmf_arg_in_1 into MATLAB session (err = 1)") Stacktrace: [1] put_variable(::MSession, ::Symbol, ::Array{Float64,2}) at C:\Users\St. Elmo.julia\packages\MATLAB\SljED\src\engine.jl:153 [2] mxcall(::MSession, ::Symbol, ::Int64, ::Array{Float64,2}, ::Vararg{Any,N} where N) at C:\Users\St. Elmo.julia\packages\MATLAB\SljED\src\engine.jl:283 [3] mxcall(::Symbol, ::Int64, ::Array{Float64,2}, ::Int64) at C:\Users\St. Elmo.julia\packages\MATLAB\SljED\src\engine.jl:317 [4] top-level scope at none:0

I tried this on multiple Julia versions (6.4 and 1.0.2) to the same effect. When I run the same function with the same matrix in Matlab it works. My suspicion is that the large matrix is causing the problem. Is there a way around it?

Ps. This approach works on smaller input matrices.

stelmo avatar Nov 28 '18 04:11 stelmo

I suffer from the same problem (I want to use Matlab's camera calibration toolbox on images (arrays of RGB) generated in Julia).

yakir12 avatar Jun 17 '19 18:06 yakir12

I suffer the same problem too... did any of you figure out a way out?

ftudisco avatar May 31 '20 15:05 ftudisco

Don't do it. I assume if you don't care about timing you could save to and load from disk...

yakir12 avatar May 31 '20 15:05 yakir12