User`s guide
Quick Start Tutorials
3-35
You will observe the effects of expression folding later in this tutorial. Not
performing expression folding allows you to see the effects of the block
output optimizations.
3 Click Apply to apply the new settings.
4 Click Generate Code, or type Ctrl+B in the model window to generate
code again.
As before, Real-Time Workshop generates code in the
example_grt_rtw
directory. Note that the previously generated code is overwritten.
5 Edit example_grt_rtw/example.c and examine the function
example_output.
With buffer optimizations enabled, the code in
example_output reuses
temporary buffers with local scope,
rtb_sin_out and rtb_gain_out, rather
than assigning global buffers to each input and output.
static void example_output(int_T tid)
{
real_T rtb_sin_out;
real_T rtb_gain_out;
rtb_sin_out = example_P.SineWave_Amp *