File Exchange Pick of the Week

Our best user submissions

Wise Goto Block

Greg's Pick this week is "Wise Goto-Block", by Markus Baranyai.

NOTE: Today's Pick comes to us from guest blogger Greg Wolff. This is Greg's first Pick; we're hoping there will be many more! [Brett and Jiro]

Contents

While I am not a strong proponent of using the GOTO and FROM blocks in Simulink Models, I do want to point out that if you choose to use these blocks in your model, Markus Baranyai’s submission makes it convenient to apply some of the best practices surrounding the use of GOTO and FROM blocks.

Signal Management Challenges Can Be Addressed With The Wise GOTO Block

Signal management in Simulink can be challenging if there are signals traveling across the Simulink model diagram, or there are lots of crossing signal lines. The GOTO and FROM blocks attempt to relieve this challenge, but end up introducing challenges of their own. There are some best practices that can be employed to make GOTO and FROM blocks more usable. This is where Markus’s MATLAB Central submission provides a lot of value. It enforces best practices by applying the same
  • Tag name
  • Size
  • Background color
  • Naming convention
to both the GOTO and FROM block:

Enhance Simulink Block Behavior With Callback Functions

Many users are unaware that the behavior of blocks within Simulink can be enhanced through the use of block or model callback functions. These are functions that are executed when certain events occur. In the case of this entry, Markus takes advantage of the NameChangeFcn, which is a function that is called when the name of the block changes. For more on block callback functions, please see the following our documentation page on the topic. Comments?

Published with MATLAB® 7.10

|
  • print

Comments

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