Target Language Compiler    

Modify the Model

  1. Delete the Sine Wave block, then replace it with a Constant block from the Library Browser.
  2. Set the parameter for the constant block to 1:10, and change the top label, model: simple_sin, to model: simple_vec.
  3. Rename the model; save your changes to simple_vec.mdl (in your working directory). The diagram now looks like this.

  1. Because the Constant block generates a vector of values, this is a vectorized model. Generate code for the model and view the MdlOutputs() section of simple_vec.c in your editor to observe how variables and for-loops are handled. This function appears as follows:

Notice that:


  Getting Started Change the Loop Rolling Threshold