How to generate c/c++ code?

2 visualizzazioni (ultimi 30 giorni)
Jelte
Jelte il 4 Ago 2014
Commentato: Rick Rosson il 14 Ago 2014
Using Matlab R2014a and Matlab coder, I'm trying to generate c or c++ code automatically from Matlab-code. In Coder, I've selected as output type: "C/C++ Dynamic Library", and enabled the option "generate code only". Building does not succeed, resulting in the message "Project ... requires an Embedded Coder license". Do I really need to also buy the toolbox "Embedded Coder"?
Above error message also appears if you try to generate code for the standard Sobel-example"
coderdemo_setup('coderdemo_edge_detection');
codegen -config coder.config('lib') sobel

Risposta accettata

Harsha Medikonda
Harsha Medikonda il 5 Ago 2014
  • For Code Generation from MATLAB Code, you would need MATLAB Coder and Embedded Coder.
  • For Code Generation using SIMULINK Models, you would need MATLAB Coder, SIMULINK Coder and Embedded Coder.For information on how you could automatically generate C/C++ code, refer to the following links Matlab Coder Conversion to C
  1 Commento
Rick Rosson
Rick Rosson il 14 Ago 2014
Embedded Coder is not required for either MATLAB Coder or Simulink Coder. It is an optional add-on that provides additional features and capabilities. For certain applications and targets, Embedded Coder is recommended, but not required.

Accedi per commentare.

Più risposte (1)

Fred Smith
Fred Smith il 14 Ago 2014
You do not need Embedded Coder for any of the activities you mention above. Embedded Coder is an add-on the enriches MATLAB Coder with additional capabilities. It is not needed for the base functionality.
The errors you mention indicate that your system believes Embedded Coder is installed, and is trying to use the license but the license checkout is failing.
You can workaround this by using coder.config(<your usual arguments here>,'ecoder',false). In the App, open the settings dialog and in the All Settings tab disable "Use Embedded Coder Features".
It would be great to understand what is special about your system that is causing this to happen. Are you using the final R2014a image or the prerelease? Did you install Embedded Coder at some time? Anything unusual would be a helpful clue.
Thanks,
Fred

Prodotti

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by