MATLAB.jl
MATLAB.jl copied to clipboard
Error: The Matlab array must either be a cell array or a double precision matrix
I have compiled lbfgsb on Linux for Matlab. and trying to run the example
with the translation of
using MATLAB
x0 = [-3 -1 -3 -1]; #% The starting point.
lb = [-10 -10 -10 -10]; ##% Lower bound on the variables.
ub = [+10 +10 +10 +10]; #% Upper bound on the variables.
mat """
$x = lbfgsb_mex($x0,$lb,$ub,'computeObjectiveHS038','computeGradientHS038',...
[],'genericcallback','maxiter',80,'m',4,'factr',1e-12,...
'pgtol',1e-5);"""
but got the error
Error using lbfgsb_mex
The Matlab array must either be a cell array or a double precision matrix
Error using save
Variable 'jx_lbfgsb_mex_arg_out_1' not found.
ERROR: MATLAB.MEngineError("failed to get variable jx_lbfgsb_mex_arg_out_1 from MATLAB session")
Stacktrace:
[1] get_mvariable(::MATLAB.MSession, ::Symbol) at /home/myname/.julia/v0.6/MATLAB/src/engine.jl:162
[2] mxcall(::MATLAB.MSession, ::Symbol, ::Int64, ::Array{Int64,1}, ::Vararg{Any,N} where N) at /home/myname/.julia/v0.6/MATLAB/src/engine.jl:291
[3] mxcall(::Symbol, ::Int64, ::Array{Int64,1}, ::Array{Int64,1}, ::Vararg{Any,N} where N) at /home/myname/.julia/v0.6/MATLAB/src/engine.jl:315
Can anyone shed light on this problem? Simple passing the arrays into matlab and get values out of it are working fine, the error occurs when I try to call the lbfgsb_mex. Note that the other calls i.e. svd, sum in MATLAB work fine.