I am using Octave for the first time today as a substitute to Matlab to try and call it from my Python script instead of using the matlab.engine. From what I've found, these two are compatible so running Matlab files in Octave is not complicated. However, one of my Matlab scripts contains the function "quadprog" which when invoked in my Octave command prompt yields the following error:
error: Invalid call to __qp__. Correct usage is:
-- [X, LAMBDA, INFO, ITER] = __qp__ (X0, H, Q, AEQ, BEQ, AIN, BIN,
MAXIT, RTOL)
error: called from
print_usage at line 98 column 5
quadprog at line 352 column 36
FRPY at line 606 column 14
RPdriver at line 388 column 21
my_VF_electrical_equivalent_circuit at line 119 column 23
hi at line 60 column 49
How can I solve this problem?
Also, I loaded the optim package in my Octave script.. to not avail, and when checking if it is already installed using this command pkg list
, it is followed by an asterisk (as it happens optim*
) what is this supposed to mean?
Regards.
The asterisk next to optim means that the package is properly loaded.
Obviously I cannot answer the other part of your question since there is no code. All I can tell you is that whatever it is you did resulted in an invalid call.
EDIT: I think I may have spotted a bug. Go to where you installed the optim package, and edit quadprog.m. Change line 353 from
__qp__ (x0, H, f, Aeq, beq, Ain, bin, maxit);
to
__qp__ (x0, H, f, Aeq, beq, Ain, bin, maxit, rtol);
and let me know if that magically makes it work.
It that's the case, I'll be reporting a bug to the octave/optim team.
EDIT 2: Turns out this is a known bug introduced in octave 6 which changed the function signature of the __qp__
function (called by quadprog.m). https://savannah.gnu.org/bugs/?59051
This has been fixed for the next release of the package; in the meantime you can just edit the code as above (the actual fix is a bit more elaborate for some reason).