Is it possible to interface Matlab with a C++ library through WSL?

조회 수: 5 (최근 30일)
frios
frios 2023년 2월 1일
답변: Sugandhi 2023년 2월 17일
I have been given a C++ library which has been designed to work only on Linux and must be interfaced with existing Matlab code.
I have achieved it on a Ubuntu machine with no major issues, but it would be desirable if it could be run on Windows. The library itself works flawlessly on WSL2, so I was wondering if there is a way to make a Matlab running on Windows work with a library that must be executed on WSL.
Thank you.

답변 (1개)

Sugandhi
Sugandhi 2023년 2월 17일
Hi Frios,
I understand that you want to know the way to interface MATLAB with a C++ library that is executed on WSL.
Absolutely, it is feasible to accomplish this. Direct calls to C and C++ library functions are possible from MATLAB. You can utilise those classes and functions directly in MATLAB if your shared library is written in C or C++ and exports functionality that can be used from another programme. In order to access the functionality in MATLAB, you must first create an interface to the library. The interface can be packaged and sent to MATLAB end users.
For more information kindly go through the following links –
To build an interface to the library -
To use prebuilt MATLAB interface to C++ Library -
To write C++ Functions Callable from MATLAB (Mex Files) -
More about calling C++ from MATLAB -

카테고리

Help CenterFile Exchange에서 Write C Functions Callable from MATLAB (MEX Files)에 대해 자세히 알아보기

태그

제품


릴리스

R2022b

Community Treasure Hunt

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

Start Hunting!

Translated by