Re: running C++ code with mutiple routines from matlab

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



runcyclexcski@xxxxxxxxx wrote:

Please don't multi-post. If it can be avoided, cross-post instead (and don't forget to set up a follow-up tag).

I have written an image processing app in Matlab which works fine when
I analyze images one at a time, but is very slow when I have to
analyze thousands of images in a row. So I re-wrote the image analysis
routine in C++, compiled in .NET. The C++ code runs about 20 times
faster than Matlab. Being a layman in programming, I am now wondering
how to make matlab talk to C++.

The C++ code is a .cpp file and an .h file. The .cpp file contains ~5
functions that talk to each other, and the main() produces the final
answer. From what I understand to make a .dll I can export functions
one at a time - is that so?

Wrong. A Dll can export more than one function. As you are using Visual C, you can use the tool Dependeny Walker (this tool shipped with Visual C 6.0, I don't know whether later versions of Visual C still contain this tool) to examine the functions that are exported by Dlls.

If yes, how can I make main () .dll talk
to the .dlls with the seconday functions and then report to matlab? Or
do I have to bundle all functionalities into the main()?

As the Dll can contain more than one function, is is not necessary.

Or is making a .dll not the right way to go?

AFAIK, Matlab cannot compile C++ code. Thus making a dll seems to be the only way to go.

Regards,
Stuart
.



Relevant Pages

  • Re: running C++ code with mutiple routines from matlab
    ... I analyze images one at a time, but is very slow when I have to ... how to make matlab talk to C++. ... From what I understand to make a .dll I can export functions ... You probably want a MEX file. ...
    (comp.soft-sys.matlab)
  • Re: running C++ code with mutiple routines from matlab
    ... I analyze images one at a time, but is very slow when I have to ... how to make matlab talk to C++. ... From what I understand to make a .dll I can export functions ... You probably want a MEX file. ...
    (comp.soft-sys.matlab)
  • running C++ code with mutiple routines from matlab
    ... I have written an image processing app in Matlab which works fine when ... I analyze images one at a time, but is very slow when I have to ... faster than Matlab. ... From what I understand to make a .dll I can export functions ...
    (microsoft.public.vc.language)
  • running C++ code with mutiple routines from matlab
    ... I have written an image processing app in Matlab which works fine ... I analyze images one at a time, but is very slow when I have to ... From what I understand to make a .dll I can export functions ...
    (comp.soft-sys.matlab)
  • Re: running C++ code with mutiple routines from matlab
    ... I analyze images one at a time, but is very slow when I have to ... how to make matlab talk to C++. ... However, Matlab can use regular C functions from a DLL, then you could expose image processing code as plain C functions. ...
    (microsoft.public.vc.language)