Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Register Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



How to convert MATLAB to C?

Software Development


Reply
 
Thread Tools Search this Thread
  #1  
Old 27-01-2010
Member
 
Join Date: Aug 2006
Posts: 201
How to convert MATLAB to C?
  

Hello Friends,
I have recently joined the digital signal processing. I am having the MATLAB codes. I want to convert these codes into C programming language. I have also tried to convert the Matlab codes to C code by using the Matlab compiler. But I am getting some errors in the header file of C. Does anyone know how to convert MATLAB to C? Please tell me, so that I can convert all Matlab codes to C.!!

__________________
Don't be afraid of darkness, it's in your heart anyway.
Reply With Quote
  #2  
Old 27-01-2010
Member
 
Join Date: Jul 2006
Posts: 286
Re: How to convert MATLAB to C?

You have to convert the MATLAB algorithms into C code manually, some years ago. Which was the slow process also many errors were used to happen. But nowadays you can use the Catalytic MCS for generating C automatically. For signal processing algorithm developers, MATLAB from the MathWorks is an essential tool. Creating the C-code model requires developers to manually translate their algorithms into C and to temporarily freeze algorithm changes. Using the Catalytic MCS can greatly ease the task of integrating MATLAB algorithms into existing C-code.
__________________
IF you hate me, please don't mention it. I know who hates me and who doesn't. You really do not have to make fun of people....
Reply With Quote
  #3  
Old 27-01-2010
Member
 
Join Date: Nov 2008
Posts: 996
Re: How to convert MATLAB to C?

I would like to suggest you to check your coding again. Perhaps there may a simple error with the include path of the compiler or something like that. Because as far as I know the Matlab to C converter works and is a well-established way to accomplish this kind of thing. What kind of errors are you getting within the header files.?? Try to include the path properly and also check the coding that you have written. Otherwise you can use the converter.
Reply With Quote
  #4  
Old 27-01-2010
Member
 
Join Date: Nov 2008
Posts: 1,192
Re: How to convert MATLAB to C?

You can also use the One-button MATLAB-to-C Conversion for converting the Matlab to C. I think it would be useful to use this application for the conversion. Also I have observed that the Matlab to C Conversion (by default) don't actually generate C code. Instead they pack up the interpreter as a standalone executable. The Catalytic One-button MATLAB-to-C Conversion has a matlab-to-C translator, which translates M to ANSI C. Hope that using this will be more useful.
Reply With Quote
  #5  
Old 27-01-2010
Member
 
Join Date: Mar 2008
Posts: 672
Re: How to convert MATLAB to C?

If you want to dump C/C++ data into Matlab workspace in run-time to visualize data and facilitate debugging, you can use the following code :
Code:
unsigned char rgb_img[44*256*172]; // 3D signal, i.e. color image
// initialize rgb_img and do something to it...
const char* command = "figure; imshow(I)";

// Dump it as 3D matrix named I. column(width):256?row(height):172 and page(channel):44,
// then view it using matlab function "imshow".
matlab << name ("I")
  << width (256) << height (172) << channel (44)
  << start (rgb_img)
  << cmd (command);
only the drawback is that calling engine APIs directly seems not to be that convenient.
Reply With Quote
  #6  
Old 27-01-2010
Member
 
Join Date: Mar 2008
Posts: 349
Re: How to convert MATLAB to C?

For the above example you can also use the openCV, because it is also supported. Check here for the coding :
Code:
IplImage* pimg; // openCV image types
// initialize p and do something to it...

// Dump pimg as matrix I. The size and types are made the same as pimg automatically.
// Then view it.
matlab << name("I") << var(pimg) << cmd("figure;imshow(I)");
Reply With Quote
  #7  
Old 17-04-2010
Member
 
Join Date: Apr 2010
Posts: 1
Re: How to convert MATLAB to C?

hello
I am in need of help. I seek the program Catalytic Mcs. I am a Tunisian student and I can not buy. so if there is a link to download or another program to translate the MATLAB C
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , , , , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to convert MATLAB to C?"
Thread Thread Starter Forum Replies Last Post
How to begin with MATLAB? Jacques25 Software Development 3 18-01-2011 07:57 AM
Matlab 7.9 crashes under Windows 7 Chandranath Windows Software 5 13-01-2010 03:58 AM
Probabilities in matlab Brunoz Software Development 5 05-01-2010 11:03 AM
Free MATLAB CD and Technical Kit Shikhar Ebooks 3 06-03-2009 08:35 PM
Calling winrar from matlab go raiden Software Development 5 02-09-2008 09:00 PM


All times are GMT +5.5. The time now is 07:35 AM.