Asked by Ijeoma Madu
on 30 Jan 2013

I want to convert this to C code

function [c]= add(a,b)

c=a+b

How is the compiler used to convert this to C, i am new to this. I do not have a Matlab coder.

*No products are associated with this question.*

Answer by Walter Roberson
on 30 Jan 2013

Accepted answer

MATLAB Coder is the only product for converting MATLAB to C.

MATLAB Compiler (a different product) does not convert to C: it converts to internal data structures that are interpreted by a MATLAB engine.

Ijeoma Madu
on 31 Jan 2013

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi test

Learn moreOpportunities for recent engineering grads.

Apply Today
## 1 Comment

## Shashank Prasanna (view profile)

Direct link to this comment:http://www.mathworks.com/matlabcentral/answers/60361#comment_126115

If you don't have MATLAB Coder, you will have to write it yourself. There is no other way to automatically generate C code out of MATLAB code.