MATLAB REAL-TIME WORKSHOP 7 - TARGET LANGUAGE COMPILER Manuale di Servizio Pagina 116

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 282
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 115
3
Writing Target Language Files
3-42
For example, given the 2-by-3 matrix
model.h defines:
typedef struct Parameters_tag = {
struct { /* S-function */
real_T matSize[2];
real_T mat[3][2];
} sfuncBlock;
struct { /* any non S-function */
real_T mat[2][3];
} nonSfuncBlock;
} Parameters;
model.prm
declares:
Paramters rtP = {
{ 2, 3 },
{ 1, 4, 2, 5, 3, 6 },
{ 1, 2, 3, 4, 5, 6 }
};
The Target Language Compiler access routines, LibBlockMatrixParameter
and
LibBlockMatrixParameterAddr, return:
LibBlockMatrixParameter(mat, "", "", 0, "", "", 1) returns
non-S-function: 2
S-function: 2
LibBlockMatrixParameterAddr(mat, "", "", 0, "", "", 1) returns
non-S-function: &rtP.nonSfuncBlock[0][1];
S-function: &rtP.sfuncBlock[1][0];
Matrix parameters are like any other TLC parameters in that only those
parameters explicitly accessed by a TLC library function during code
generation are placed in the parameters structure. So,
matSize is not declared
123
456
Vedere la pagina 115
1 2 ... 111 112 113 114 115 116 117 118 119 120 121 ... 281 282

Commenti su questo manuale

Nessun commento