How can I use C code generated by Matlab coder?
Afficher commentaires plus anciens
I'm trying to use a simple function generated from matlab coder on my PIC MCU. The matlab function is:
function [c] = myMult(a)
b = [1,2,4;
7,1,2;
8,4,9];
c = a.*b;
And the generated C code is:
/*
* myMult.c
*
* Code generation for function 'myMult'
*
* C source code generated on: Wed Jul 17 10:22:38 2013
*
*/
/* Include files */
#include "myMult.h"
/* Function Definitions */
void myMult(real_T a, real_T c[9])
{
int32_T i0;
static const int8_T b[9] = { 1, 7, 8, 2, 1, 4, 4, 2, 9 };
/* Mult */
for (i0 = 0; i0 < 9; i0++) {
c[i0] = a * (real_T)b[i0];
}
}
/* End of code generation (myMult.c) */
+ some other header files
So, how can I work with function:
void myMult(real_T a, real_T c[9])
Shouldn't be return value instead of void? Shouldn't be between () only one, input value? I generated C code same way like in webinar MATLAB to C Made Easy.
Thank's for replies
Viktor
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!