Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Matlab to C conversion

Status
Not open for further replies.

Girly_girl

Full Member level 2
Joined
Oct 14, 2009
Messages
143
Helped
9
Reputation
18
Reaction score
8
Trophy points
1,298
Location
UK
Activity points
2,125
hello all,
I have 2 questions regarding the conversion of matlab code to C ...

1 - Can the self written matlab codes be converted to c? or is the conversion only possible when simulink is used?

2- Can the MATLAB codes be put into a embedded DSP system? or does it necessary need to be in C ?

Thanks
 

Yes, apparently you can compile to C with the MATLAB Compiler Toolbox. Simulink is not necessary.
**broken link removed**
But I think thats for executables. What you want is Embedded MATLAB:
From MATLAB to Embedded C

I have not tried either, but I have had my eye on them for a while. If you use either let me know how it works out for you. I have never heard of an embedded system running MATLAB code, hence the reason for the existence of Embedded MATLAB. As you probably already know, MATLAB is much slower than C.
 
Trav1s, Thanks for your kind and quick reply,
I will go through both pages you provided..
Sure will let you know.
Thanks again

---------- Post added at 12:33 ---------- Previous post was at 12:17 ----------

I have just gone through the "From MATLAB to Embedded C" page..
It states that::

Key Features for MATLAB Users

By using MATLAB code written with the Embedded MATLAB subset, you can automatically generate C code directly from MATLAB for embedded software prototyping and implementation. You can also:

* Use MATLAB and Fixed-Point Toolbox™ to develop embeddable floating-point and fixed-point algorithms and run simulations at compiled C speed
* Use Real-Time Workshop® to automatically generate C code directly from MATLAB functions


How can i enable this Embedded MATLAB subset?
 

My understanding is that this basically means the compiler does not support all MATLAB commands, but only a subset. You already have been using this subset. Most of the MATLAB commands are part of the Embedded MATLAB subset. However, some of the commands are not supported and thus not within the subset. Dynamic memory allocation is also not supported. Heres the run down:
**broken link removed**
 
Did you find either the MATLAB Coder or Compiler to be useful at all? Anything to watch out for in using them?
 

Thanks for chasing this up.. well it has become apparent to me that when that compile disccuessed above is used, it produces an exe file which is a binary file.. so not a c code at all..
people have done it from C to matlab but not the other way round.. !!
 

Do you mean C to MATLAB ? You can search for "mex files" to see if the other way around is valid.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top