How can I use C code generated by Matlab coder?
显示 更早的评论
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
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 MATLAB Coder 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!