MATLAB: which language interface to use when calling external library functions offered with different interfaces?

Still very new to MATLAB and to programming in general, I am stuck figuring out how to best profit from what is described in the official MATLAB documentation under Calling External Functions. I can no longer judge which of the proposed paths can be the most effective in order to move forward, in terms of how easy the path can be learned by a beginner, and which in the long term can be most easily and clearly MATLAB code is applied over and over again ...

To pose it to a very practical question: how, for example, the third-party processing function libraries ITK or OpenCV provide interfaces for Java, C ++, C and Python, and MATLAB has functions for addressing such interfaces that a newbie in programming should choose? Is one of them usable in clearer designs and therefore easier to keep warm and quicker to learn to apply?

Now I'm afraid to hear from everyone something like "ok, it depends on what you want to do", and my answer may be "I don't know yet", I am learning programming and prefer to first get general success by moving to a more understandable and understandable approach, and therefore would like a recommendation on where to start. "

Please allow me to add this to my question and questions: the highly respected Yair Altman states on his internet page "undocumentedmatlab.com" in an advertisement for his book "Undocumented Matlab-Java Programming Secrets" that the Matlab programming environment relies on Java for a variety of tasks including networking, data processing algorithms and graphical user interface (GUI). I am proceeding from this statement that learning a special MATLAB to JAVA connection would have significant benefits, MATHWORKS itself decided to use such a connection when implementing MATLAB.

But I can also see that THE MATHWORKS, by providing MATLAB, the MEX functionality seems to lean towards hard-coded C / C ++ implementation, providing MEX as well, besides the other possibilities of calling external C functions.

For me, as for beginners, now it becomes unclear to identify which way of connecting to external languages ​​can be taken as "standard" or "first to be recommended". Any of you have experienced programmers, I would have some arguments for me, which path first? It's a long way to learn programming, and I don't want to waste time on poorly recommended paths.

+3


source to share


2 answers


For starters, you can find Interfacing MATLAB and Java (this is the easiest way to find out)

Subsequently, Go for MATLAB and C ++ interoperability

1. Create Classes and Gateway in C++ for MATLAB and create executable mex file
2. Create MATLAB function and Wrap in C++  (Shared C/C++ library approach)

      



Then go to create Excel add-ins and call them in Excel sheets

In the meantime, you can search for dll references in C # .net application / VB.net application

0


source


The question goes like this: "I am still a driving driver, but not a very experienced driver. Please give me advice on how to change a flat tire, what is the best tire to get a flat tire, passenger side rear? What are the best places to get?" flat bus, is it a mall or my service car park or in the middle of the street. "

Let me give you some tips:

  • Changing the tire won't make you a more knowledgeable driver. You will learn very few things from this and it is a frustrating experience and it is not worth your time right now. Learn how to manage.

Explanation: Making a MATLAB call to Java / C ++ / C or any other language will not make you a better MATLAB programmer and, frankly, is of secondary importance. As long as the first sentence of your question doesn't "I'm still new to MATLAB and programming in general", you're wasting your time. As a flat bus change, connecting MATLAB to other languages ​​is not fun or interesting, in fact the opposite is true: it is frustrating, error prone and bored.



  • The day will come when you will have a flat tire. On that day, the place where you acquire it and which tires it will become secondary. You will need to find out how to change it and you will. Trust me you will.

Explanation: . You cannot decide what language the code is written in that solves the exact problem you are currently having. Likewise, you cannot decide where to get a tire. The day will come when you already know C ++ and you need MATLAB to call C ++ code (either your code or someone else's). On this day, you need to learn how to write a mex file in C ++ and compile it for your platform and call the code. Or the day will come when you need to call Java and then you will learn how to call in Java.

Imposing it when you don't know what you need to do and you are clearly not technically prepared, it is just a waste of time.

+3


source







All Articles