Click here to Skip to main content
15,904,416 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have a project written in Matlab contains multiple matlab functions (written in structured oriented way). I want to convert those files to C, is there any tool or online websites avilable to achive this. I tried with google search but I couldn't find any right one. Somebody please help me.

Thanks in advance
Posted
Comments
Albert Holguin 22-Nov-11 10:58am    
This question has come up a lot before in the past, do a search through CodeProject for other solutions. As a matter of fact, searching the site should be your first option.

Dear Ajain,

One way is to convert matlab code to C is study the existing code i.e matlab code and find out the similar functions in C. And if for some functions you dont found the similar function then write your own function which will provide you the same functionality as matlab functions.
 
Share this answer
 
Comments
Ajain A K 22-Nov-11 23:51pm    
Dear Laxmikant_Yadav,

Thanks a lot for your answer. I am less experienced in both languages, my actaual requriement is to plot some code structre diagram using some third
party tools for matlab code analysis. Matlab codes are less compactable to all these tools but C codes are very much compactable
that is why I want to convert the code from matlab to C Code. I am bit bit disappointed as well, I have to follow according as you say :)
Hi there are things called Mex files which you can use C code in. Format is as follows.

http://www.mathworks.co.uk/support/tech-notes/1600/1622.html[^]

they also do a product which will convert your matlab code directly in C.

http://www.mathworks.co.uk/company/pressroom/MathWorks-Introduces-Automatic-C-Code-Generation-Directly-from-MATLAB-Language.html[^]

However i do not know of you budget or how good this product is. Your best bet as Laxmikant_Yadav says is to write the code in C and then use the Mex file to allow you existing code to use the C functions within matlab.

In fact this might be the best way as you can improve the mex files as your knowledge increases....

happy coding.
 
Share this answer
 
v2
Comments
Ajain A K 22-Nov-11 23:57pm    
Dear SafarTimura,

Thanks a lot for your solution and useful web links, I am reading it thoroughly. Hope something will work favorable to my requirement, if so
I will get back to you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900