이 페이지의 최신 내용은 아직 번역되지 않았습니다. 최신 내용은 영문으로 볼 수 있습니다.
Python용 MATLAB Engine API는 Python용 패키지를 제공하여 MATLAB을 계산 엔진으로 호출합니다. 이 엔진은 참조 구현(CPython)을 지원하며 MATLAB은 버전 2.7, 3.6 및 3.7을 지원합니다.
이 엔진을 설치하고 시작하려면 Python용 MATLAB Engine API 시작하기 항목을 참조하십시오.
MATLAB에서 Python 함수를 호출하려면 Python Libraries in MATLAB 항목을 참조하십시오.
엔진 응용 프로그램을 사용하려면 MATLAB이 설치되어 있어야 합니다. MATLAB Runtime만 설치된 컴퓨터에서는 MATLAB 엔진을 실행할 수 없습니다.
Python용 MATLAB Engine API에 대한 시스템 요구 사항
Python용 MATLAB 엔진 응용 프로그램을 작성하고 빌드하는 데 필요한 사항입니다.
Python용 MATLAB Engine API 설치하기
Python 세션 내에서 MATLAB 엔진을 시작하려면 먼저 Engine API를 Python 패키지로 설치해야 합니다.
디폴트가 아닌 위치에 Python용 MATLAB Engine API 설치하기
기본적으로, 인스톨러는
폴더에 Python용 Engine API를 빌드합니다. 다른 폴더에 설치할 경우에는 matlabroot
\extern\engines\pythonPYTHONPATH
환경 변수를 업데이트하십시오.
Python용 MATLAB Engine API 시작하기
Python용 MATLAB Engine API는 matlab
이라는 이름의 Python 패키지를 제공하며, 이 패키지를 사용해 Python에서 MATLAB 함수를 호출할 수 있습니다.
Python용 MATLAB 엔진을 시작하기 위한 옵션.
MATLAB 함수에서 출력 인수를 반환하는 방법. 함수에서 여러 출력값을 읽는 방법. MATLAB 함수가 출력 인수를 반환하지 않을 때 수행할 작업.
Get Help for MATLAB Functions from Python
From Python, you can access supporting documentation for all MATLAB functions.
이 예제에서는 Python에서 MATLAB 엔진 작업 공간에 변수를 추가하는 방법을 보여줍니다.
이 예제에서는 Python에서 MATLAB 배열을 만들고 이 배열을 MATLAB sqrt
함수에 입력 인수로 전달하는 방법을 보여줍니다.
matlab
Python 패키지는 MATLAB 숫자형 배열을 Python 변수로 나타낼 수 있는 배열 클래스를 제공하여, Python과 MATLAB 간에 MATLAB 배열을 전달할 수 있도록 합니다.
Python 데이터를 MATLAB 함수에 대한 입력 인수로 전달할 경우 Python용 MATLAB 엔진이 데이터를 그에 해당하는 MATLAB 데이터형으로 변환합니다.
MATLAB에서 Python으로 반환된 데이터 처리하기
MATLAB 함수가 출력 인수를 반환하면 Python용 MATLAB Engine API는 이 데이터를 상응하는 Python 데이터형으로 변환합니다.
Use MATLAB Handle Objects in Python
This example shows how to create an object from a MATLAB handle class and call its methods in Python.
Default Numeric Types in MATLAB and Python
MATLAB stores all numeric values as double-precision floating point numbers by default.
이 예제에서는 MATLAB 스크립트를 호출하여 Python에서 삼각형의 면적을 계산하는 방법을 보여줍니다.
Sort and Plot MATLAB Data from Python
This example shows how to sort data about patients into lists of smokers and nonsmokers in Python and plot blood pressure readings for the patients with MATLAB.
Call MATLAB Functions Asynchronously from Python
This example shows how to call the MATLAB sqrt
function
asynchronously from Python and retrieve the square root later.
Redirect Standard Output and Error to Python
This example shows how to redirect standard output and standard
error from a MATLAB function to Python StringIO
objects.
Limitations to MATLAB Engine API for Python
The MATLAB Engine API does not support these features.
Troubleshoot MATLAB Errors in Python
When a MATLAB function raises an error, the MATLAB Engine for Python stops the function and catches the exception raised by MATLAB.