From Matlab to C

  • Follow


  Hello to all Matlab developers,

  I made several Matlab applications, but the main problem is the speed of execution. I heard that it is possible to implement Matlab code int C code for extra speed.

  Has anyone had any success with this idea, and if so, what are the main steps and tools?

  Kind regards,
  Jean.
0
Reply Jean 5/20/2010 12:50:07 PM

Dear Jean!

>   I made several Matlab applications, but the main problem is the speed of execution. I heard that it is possible to implement Matlab code int C code for extra speed.
> 
>   Has anyone had any success with this idea, and if so, what are the main steps and tools?

The first step of increasing the speed is finding the bottlenecks. It is very likely, that the lines of the program, which needs the longest time, can be accelerated by using improved Matlab coding.
After fixing a suffcient number of bottlenecks in Matlab, you can decide, if it might be helpful to rewrite some functions in C and compile them as Mex function. There are a lot of examples shipped with Matlab and in the FEX.

Good luck, Jan
0
Reply Jan 5/20/2010 1:25:20 PM


Jean wrote:

>  I made several Matlab applications, but the main problem is the speed 
> of execution. I heard that it is possible to implement Matlab code int C 
> code for extra speed.
> 
>  Has anyone had any success with this idea, and if so, what are the main 
> steps and tools?

In Matlab 6, it was possible to compile Matlab in to C, but it is no 
longer possible, except for Embedded Matlab and for the Real Time 
Workshop Toolkit (and possibly Simulink, I'm not sure about that one.)

There is a deployment tool which is *called* a "compiler", but it just 
makes an executable out of the files but keeps the same speed (and 
sometimes slower.)
0
Reply Walter 5/20/2010 2:30:13 PM

2 Replies
207 Views

(page loaded in 0.037 seconds)

Similiar Articles:













7/26/2012 9:33:59 AM


Reply: