matlab to c conversion
1 view (last 30 days)
Show older comments
I have developed my code in matlab. It consists of nested loops (8 external loops each having 37000 loops). Thus i plan to convert the code in c language for fast result.At Present it is takes 30 minutes for execution.
I heard about CATALYTIC MCS and EMLC softwares. but could find link to download one. please suggest links for aforesaid softwares.
0 Comments
Accepted Answer
More Answers (1)
Walter Roberson
on 19 Jul 2011
Possibly using the Parallel Programming Toolbox would be an useful alternative approach. And perhaps some of the loops can be vectorized.
Have you used the Profiler to determine which parts of your code are taking the most time?
2 Comments
Walter Roberson
on 19 Jul 2011
I do am not sure why that kind of configuration would lead to 8 outer loops, rather than to a loop from 1:8 that indexed the appropriate variables and passed them in to a common processing loop? Or instead of a configuration with 8 loops, a configuration with BytesAvailableFcn callbacks that buffered the data and made it available to the processing function, possibly with the aid of some semaphores if part of the code might be waiting on data from some particular sensor to become available?
I am a bit confused about the data that is being read in from the sensors and how that relates to the "each time for one bit check" ?
How many cores are available on your system? Is the computation done at each point extensive, or is mostly a lot of data marshaling? Does the system need semi-realtime output, or is it the case that if in theory you managed to get all the data collected ahead of time (perhaps timestamped as to the order) the data could then be processed in a group to produce the output ?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!