Effacer les filtres
Effacer les filtres

coverting to c code

3 vues (au cours des 30 derniers jours)
Rajesh
Rajesh le 8 Fév 2012
Modifié(e) : Youssef Khmou le 13 Oct 2013
i’m converting Matlab code to static c code, i found two ways to convert the code. Both are producing diff code, I just want to know which the correct way of code conversion. following the two commends ,
codegen -c pca
coder -new pca.prj
thanks
Rajeshkumar.c

Réponses (3)

Mike Hosea
Mike Hosea le 13 Fév 2012
CODEGEN is the command-line way, CODER is the graphical user interface. It's the same technology "under the hood". I expect "codegen" and "coder" to generate the same code if you are using all the same options.
  1 commentaire
Rajesh
Rajesh le 15 Fév 2012
Hello Mr.mike,
i'm using the same options for both. but i am getting different outputs. if u like i can send those codes to you for comparison

Connectez-vous pour commenter.


Titus Edelhofer
Titus Edelhofer le 15 Fév 2012
Hi Rajesh,
just to confirm: I guess you invoke coder by
coder -build pca.prj
instead of "-new"? I just gave it another try with a larger project, and apart from the new build date, the generated codes were identical ...
What kind of differences in the code do you see?
Titus
  2 commentaires
Rajesh
Rajesh le 16 Fév 2012
Hi Mike,
yesterday when i was going through my code realized a different. when i give "coder -new pca.prj " its generating c code. and while i'm giving codegen -c pca it's generating a mex code.. . and then i created a mex code using coder -new pca.prj, both are matching. . .
Rajesh
Rajesh le 16 Fév 2012
i mean both the mex files are matching. .

Connectez-vous pour commenter.


Rajesh
Rajesh le 16 Fév 2012
Hello Mike,
i tried with coder -build pca.prj. it's producing the same output produced by "coder -new pca.prj ".

Catégories

En savoir plus sur MATLAB Code Analysis dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by