Target Language Compiler | ![]() ![]() |
Modify the Model
1:10
, and change the top label, model: simple_sin
, to model: simple_vec
.
simple_vec.mdl
(in your working directory). The diagram now looks like this.
MdlOutputs()
section of simple_vec.c
in your editor to observe how variables and for
-loops are handled. This function appears as follows:
/* Compute block outputs */ void MdlOutputs(int_T tid) { /* This is a single rate system */ (void)tid; /* Outport: '<Root>/Out' incorporates: * Gain: '<Root>/Gain' * Constant: '<Root>/Constant' * * Regarding '<Root>/Gain': * Gain value: rtP.Gain_Gain */ { int_T i1; real_T *y0 = &rtY.Out[0]; for (i1=0; i1 < 10; i1++) { y0[i1] = (rtP.Gain_Gain * rtP.Constant_Value[i1]); } } }
i1
runs from 0 to 9.
*y0
is used and initialized to the output signal array.
![]() | Getting Started | Change the Loop Rolling Threshold | ![]() |