|
Well, I figured it out. My MatLab function definition need
to specify output like the following:
function r = deconvX(b,a)
I had it as:
function deconvX(b,a,r)
Apparently Embedded MatLab needs to see what is left of
the "=" to determine the function output.
Bill
"Bill " <john.doe.nospam@mathworks.com> wrote in message
<g1keq2$egl$1@fred.mathworks.com>...
> Pardon the confused question, but here goes - I just
> started with Embedded MatLab today, so I am probably
making
> some stupid mistake, but nonetheless here is what is
> happening:
>
> >> emlc check_parity_sacch -eg { rx_block1, PARITY_CHK } -
> c -T rtw:lib -report
>
> Compilation successful: Open compilation report.
>
> Well I open the compilation report, and open the "c" file
> and here it is:
>
>
> 1 /*
> 2 * check_parity_sacch.c
> 3 *
> 4 * Embedded MATLAB Coder code generation for M-
> function 'check_parity_sacch'
> 5 *
> 6 * C source code generated on: Wed May 28 16:03:12 2008
> 7 *
> 8 */
> 9
> 10 /* Include files */
> 11 #include "check_parity_sacch.h"
> 12
> 13 /* Type Definitions */
> 14
> 15 /* Variable Declarations */
> 16
> 17 /* Variable Definitions */
> 18
> 19 /* Function Declarations */
> 20
> 21 /* Function Definitions */
> 22 void check_parity_sacch(real_T *eml_rx_block, real_T
> *eml_PARITY_CHK)
> 23 {
> 24 /* #eml */
> 25 /* Parity check */
> 26 /* I have no idea what this does, but all bits in out
()
> are 1 and that must */
> 27 /* mean something? I assume it means the parity is ok.
> */
> 28 /* [q,re] = deconv(d,g); */
> 29 }
> 30
> 31 void check_parity_sacch_initialize(void)
> 32 {
> 33 rt_InitInfAndNaN(8U);
> 34 }
> 35
> 36 void check_parity_sacch_terminate(void)
> 37 {
> 38 }
> 39
> 40 /* End of Embedded MATLAB Coder code generation
> (check_parity_sacch.c) */
>
> All of the "c" code is missing. The function that I
trying
> to convert is the following:
>
> g = zeros(1,41);
> re = zeros(184,184);
> g = [1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0
0
> 0 0 0 0 0 0 0 0 0 0 1 0 0 1];
> d = [rx_block PARITY_CHK];
> %[q,re] = deconv(d,g);
>
> L = 0;
> L = length(re);
> out = abs(re(L-39:L));
> for n = 1:length(out),
> if ceil(out(n)/2) ~= floor(out(n)/2)
> out(n) = 1;
> else
> out(n) = 0;
> end
> end
>
>
> Any ideas what happened?
>
> Bill
|