JAVA or C++? Which one works better with MATLAB?

조회 수: 8 (최근 30일)
Mehdi
Mehdi 2015년 4월 29일
댓글: Guillaume 2015년 4월 29일
Hi,
Which one is more interactive with MATLAB? JAVA or C++?

채택된 답변

Guillaume
Guillaume 2015년 4월 29일
Matlab's desktop environment is built on top of java and you can call java functions easily from matlab.
Saying that, you can also interact very easily with .Net
Matlab can't talk to C++ directly, but it can talk to dlls as long as they use the C calling convention.
  댓글 수: 2
Mehdi
Mehdi 2015년 4월 29일
Thank you very much.
I understand the following code has to be used to call the .dll file based on the link you sent me:
loadlibrary(libname,hfile)
calllib('your_dll', 'funcname', arg1, ..., argN)
I'm not familiar with dlls. What should I put for hfile and arg1 for the dll file (zipped) that I have attached? How would you call this file into your code?
Thanks anew.
Guillaume
Guillaume 2015년 4월 29일
arg1, ..., argn are the arguments for the function you want to call. Only the dll documentation can tell you what they are.
The hfile is ideally the header file (.h) that has been used to build the library. That should come from the author of the dll. If you don't have it, you may be able to create a proto file instead from the documentation. Its purpose is to tell matlab what the types of the arguments are, so it can convert matlab variables into their C equivalent.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by