Guy on Simulink

Simulink & Model-Based Design

What’s New in R2015b – Part 2

This week we continue looking at new features in R2015b. After going through editing features, let's now look at new features affecting how blocks work.

Waveform Generator Block

Using a simple and intuitive syntax, the Waveform Generator block allows you to create signal made of combinations of classic signal: Constant, Gaussian Noise, Pulse, Sawtooth, Sine Wave, Square, and Step.

Waveform Generator

From Spreadsheet Block

The new From Spreadsheet block can read data directly from Microsoft Excel or CSV files. Just specify the file and sheet names to get the data into your model.

From Spreadsheet Block

Integrator Wrapped State

If you are dealing with applications with rotary or cyclic states, you will like this one. Before this functionality, if you wanted to make an integrator wrap, you had two options.

The first one was to implement something like Top Dead Center Detection to accurately reset the Integrator at the wrapping. If nothing special needs to happen at this time in your simulation, this is not efficient as many unnecessary solver resets and zero-crossing events are generated, slowing down the model. You can see an example of such logic in the example sldemo_engine.

The second option is to not wrap the Integrator state, but instead to post-process it, for example using a mod operation. This avoids the inefficiency of the previous method, but as the Integrator state grows toward infinity, computations become less accurate, limiting the simulation stop time.

The wrapped state option of the Integrator offers the advantages of both method: no zero-crossing necessay at the wrapping, and the state value remains of reasonable amplitude.

Integrator Wrapped State

The MATLAB Function block can be non-directfeedthrough

In some cases, the output at the current time step of your code in the MATLAB Function block does not depend directly on the input values, but only on persistent variables. This means that technically, the block could break an algebraic loop. To take advantage of this feature, uncheck the Allow direct feedthrough option in the Port and Data Manager for this block.

The MATLAB Function block can now be non-directfeedthrough

Improved way of specifying Evenly-Spaced Points in Lookup Table Blocks

Before R2015b, if you wanted to use the Evenly Spaced Points interpolation method in the Lookup Table blocks, you have to provide a set of breakpoints evenly spaced to the last bit of precision. Once that had been verified, during code generation only a starting point and a spacing were used, for maximum code efficiency. As you probably figured out, this was a bit convoluted.

In R2015b, you have two ways of specifying breakpoints: Explicitly or Evenly Spaced. In the Evenly Spaced case, you directly provide the starting point and the spacing, and the interpolation method automatically becomes Evenly Spaced Points.

Improved way of specifying Evenly-Spaced Points in Lookup Table Blocks

Now it's your turn

Are you going to take advantage of those new features? Let us know by leaving a comment here.

|
  • print

Comments

To leave a comment, please click here to sign in to your MathWorks Account or create a new one.