이 번역 페이지는 최신 내용을 담고 있지 않습니다. 최신 내용을 영문으로 보려면 여기를 클릭하십시오.
MATLAB 인터페이스를 C++ 라이브러리에 작성하기
clibgen
패키지를 사용하십시오.C++ 라이브러리에 대한 MATLAB 인터페이스를 작성(퍼블리시)하려면 C++ 라이브러리에 대한 MATLAB 인터페이스를 퍼블리시하는 단계 항목을 참조하십시오.
MATLAB에서 라이브러리의 함수를 호출하는 방법에 대한 자세한 내용은 사전 작성된 MATLAB 인터페이스를 C++ 라이브러리에 사용하기 항목을 참조하십시오.
함수
clibgen.generateLibraryDefinition | Create definition file for C++ library |
clibgen.buildInterface | Create interface to C++ library without definition file |
패키지
clibgen 패키지 | C++ 라이브러리 기능 호출을 지원하는 MATLAB 패키지 및 클래스 요약 |
도움말 항목
인터페이스를 퍼블리시하는 방법
- What Types of Files Define Your Library?
How to set the arguments to theclibgen.generateLibraryDefinition
function. - C++ 라이브러리에 대한 MATLAB 인터페이스를 퍼블리시하는 단계
C++ 라이브러리에 대한 인터페이스를 퍼블리시하는 방법을 간략히 설명합니다. - Requirements for Building Interface to C++ Libraries
Requirements for calling functions in external, compiled C++ libraries from MATLAB. - Distribute MATLAB Interface to C++ Library
How to share your MATLAB interface with MATLAB users.
헤더 및 컴파일된 라이브러리 파일에서 정의한 라이브러리
- Windows에서의 헤더 및 컴파일된 라이브러리 파일
이 예제에서는 가져오기 라이브러리 파일
matrixOperations.lib
를 사용하여 C++ 라이브러리에 대한 MATLAB 인터페이스를 만듭니다.- 단계 1:
- 단계 2: 누락된 구문 정의하기
- 단계 3:
- 단계 4:
- Linux에서의 헤더 및 컴파일된 라이브러리 파일
이 예제에서는 공유 오브젝트 파일
libmwmatrixOperations.so
를 사용하여 C++ 라이브러리에 대한 MATLAB 인터페이스를 만듭니다.- 단계 1:
- 단계 2: 누락된 구문 정의하기
- 단계 3:
- 단계 4:
- Header and C++ Compiled Library Files on macOS
This example creates a MATLAB interface to a C++ library with a dynamic shared library file
libmwmatrixOperations.dylib
.- 단계 1:
- 단계 2: 누락된 구문 정의하기
- 단계 3:
- 단계 4:
헤더/CPP 소스 파일에서 정의한 라이브러리
- 헤더 및 CPP 소스 파일
이 예제에서는 소스 파일
matrixOperations.hpp
및matrixOperations.cpp
에 정의된 C++ 라이브러리에 대한 MATLAB 인터페이스를 만듭니다.- 단계 1: 인터페이스 생성하기
- 단계 2: 누락된 구문 정의하기
- 단계 3:
- 단계 4: matrixoperations 라이브러리 함수 호출하기
- 헤더 전용 HPP 파일
이 예제에서는 헤더 파일
school.hpp
에 정의된 C++ 라이브러리에 대한 MATLAB 인터페이스를 만듭니다.- 단계 1:
- 단계 2:
- 단계 3:
- 단계 4:
정의 및 사용자 지정
- Define MATLAB Interface for C++ Library
Generate and edit the MATLAB library definition file to customize and define the interface.
- Publish Help Text for MATLAB Interface to C++ Library
Provide documentation for end-users of a MATLAB interface to a C++ Library.
- C++ to MATLAB Data Type Mapping
Correspondence of MATLAB data types to C/C++ types. - Lifetime Management of C++ Objects in MATLAB
MATLAB rules for managing memory for C++ objects created in a MATLAB interface to a C++ compiled library. - Initialize Pointer Members of C++ Structures for MATLAB Interface to Library
Verify that C++ class constructors initialize pointer members.
문제 해결
Build C++ Library Interface and Review Contents
If library functionality is missing, the library might contain unsupported language features or data types.
C/C++ library features not supported in MATLAB.
Troubleshooting C++ Library Definition Issues
Information for resolving error when publishing a MATLAB interface to a C++ library.