Hello everyone,
I am trying to use Cantera with Matlab. I am using matlab v2020b, Visual Studio 2022, python 3.13 and use Cantera v3.0 as v3.1 seems not to be compatible with the Matlab interface, as mentioned on their website. I tried several solutions, but I am still stuck, and the documentation for v3.0 is no longer available: https://cantera.org/install/index.html (not found). - First, I tried using conda with the following command:
conda create --name ct-env --channel cantera cantera cantera-matlab
However, after setting the ctpath.m, I encountered the following error:
gas = Solution('gri30.xml') Invalid MEX-file 'C:\Users\*\*.conda\envs\ct-env\share\cantera\matlab\toolbox\ctmethods.mexw64': The specified procedure could not be found.
The MEX file is present but seems to not be working.
2. I also tried cloning the Git repository, followed by scons build and installation.
This gave me the Matlab experimental folder. I followed the README procedure and changed the ctRoot.m to put the path to my conda environment, but I encountered this error:
Error using loadlibrary Could not find file C:\Users\*\*.conda\envs\ct-env2\include\cantera\clib\ctmatlab.h.
Lastly, I tried using the Python extension, and it works: such as py.cantera.Solution('gri30.yaml') cmd. However, I do not want to be dependent on Python, as I may need to compile my code using Simulink/Matlab Coder.
Have a nice day!