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

Error: The Matlab array must either be a cell array or a double precision matrix #132

Open
Dlng opened this issue Feb 8, 2018 · 0 comments

Comments

@Dlng
Copy link

Dlng commented Feb 8, 2018

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.

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

1 participant