How do I setup the Python Interpreter for Matlab 2014b for Windows OS

8 ビュー (過去 30 日間)
Jim Hokanson
Jim Hokanson 2014 年 10 月 4 日
コメント済み: Jim Hokanson 2017 年 12 月 12 日
In Matlab 2014b there is support for calling Python directly from Matlab.
See help CallPythonExample for an example
But I'm running Windows and the example doesn't work.
T = 'MATLAB® is a high-level language and interactive environment for numerical computation, visualization, and programming. Using MATLAB, you can analyze data, develop algorithms, and create models and applications. The language, tools, and built-in math functions enable you to explore multiple approaches and reach a solution faster than with spreadsheets or traditional programming languages, such as C/C++ or Java™.';
wrapped = py.textwrap.wrap(T);

採用された回答

Jim Hokanson
Jim Hokanson 2014 年 10 月 4 日
編集済み: Jim Hokanson 2014 年 10 月 4 日
Use:
pyversion(executable_path)
to specify the path to the Python executable.
In Python you can run:
import sys
print(sys.executable)
to get the executable_path
  2 件のコメント
Sahel Fallahdoust
Sahel Fallahdoust 2017 年 12 月 12 日
can it be done within the Matlab code (like in the beginning of the function for example)? Cause I have a matlab exe which is calling to some python modules but when I run the exe, it's like it can not find the python executable.
Jim Hokanson
Jim Hokanson 2017 年 12 月 12 日
These questions are best asked as a separate question. I don't know the answer off the top of my head.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by