cobratoolbox icon indicating copy to clipboard operation
cobratoolbox copied to clipboard

Error in initCobraToolbox (line 358, 460)

Open SiYeon-Ju opened this issue 2 years ago • 4 comments

Please include a short description of problem here I hereby confirm that I have:

  • [ ] Tried to solve the issue on my own
  • [X] Retried to run my code with the latest version of The COBRA Toolbox
  • [ ] Checked that a similar issue has not already been opened (Note: You may replace [ ] with [X] to check the box)

Hi, I have used latest cobratoolbox( Master version) in Matlab 2017b . But, i had some error in 'initCobraToolbox' as blow.

=========================================
Checking available solvers and solver interfaces ...Undefined function 'contains' for input arguments of type 'cell'.

Error in changeCobraSolver (line 358)
if ~contains(solverType, OPT_PROB_TYPES

Error in initCobraToolbox (line 460) [solverOK,solverInstalled] = changeCobraSolver(supportedSolversNames{i},SOLVERS.
(supportedSolversNames{i}).type{1},0, 2);
=========================================

Any idea what might cause this error?

SiYeon-Ju avatar Aug 05 '22 05:08 SiYeon-Ju

Could you run your code again setting "break on error" (under the "Run" button), and tell us the contents of the OPT_PROB_TYPES, solverType and solverName variables?

tpfau avatar Aug 05 '22 06:08 tpfau

In addition: What is the output of which contains?

tpfau avatar Aug 05 '22 06:08 tpfau

Sorry!! My matlab version is 2014b, "Run" button not found.

Is there any other way to check the contents (OPT_PROB_TYPES, solverType and solverName)?

Thanks!

SiYeon-Ju avatar Aug 08 '22 01:08 SiYeon-Ju

The Toolbox relies on several functions introduced in Matlab 2016b, so it will not work on 2014b. You can try to use an old version of the toolbox (e.g. 2.0 but that wont have newer functionalities and might contain bugs. This includes the contains function which is causing your problems.

tpfau avatar Aug 08 '22 05:08 tpfau