How to activate Anaconda environment in Matlab?

55 ビュー (過去 30 日間)
Gerard Borrego
Gerard Borrego 2021 年 7 月 21 日
回答済み: Gerard Borrego 2021 年 7 月 21 日
I'm making a code in Matlab that it makes iterations of a complex python code. To do so, it is necessary to change the anaconda environment in matlab code.
If I do it manually in CMD it works fine. The CMD steps that I make are the following:
  1. Activate environment--> C:\Anaconda3\Scripts\activate.bat
  2. Change directory--> cd C:\Anaconda3\master_RH %(directory where all the python files are placed)
  3. Execute code-->python C:\Anaconda3\master_RH\MAIN.py * C:\Anaconda3\*
With Matlab system command I'm able to do steps 2 and 3, but it seems that step 1 is not done correctly because the program does not run well because the environment hasn't been updated properly.
If someone could help me I would be totally grateful.

採用された回答

Gerard Borrego
Gerard Borrego 2021 年 7 月 21 日
I have found the solution here:
https://es.mathworks.com/matlabcentral/answers/443558-matlab-crashes-when-using-conda-environment-other-than-base

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCall Python from MATLAB についてさらに検索

製品


リリース

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by