Simulink

From MotoHawk
Jump to navigationJump to search

Simulink is ...

Common Problems with Simulink

No tool is perfect and Simulink is no different. As Simulink users, we've encountered many issues that we've had to overcome. This section lists a few of them that we've encountered thus far.

Editing shortcuts

Here are some Simulink editing shortcuts.

Drop Down List

In short, drop down lists are implemented really really poorly in Simulink masks. The first time you open a block, it will go to the library and grab the list from that library block. On the surface, that doesn't seem so bad. But if you want to implement a dynamic list (such as our resource lists), you will quickly realize this "feature" is actually an enormous obstacle. The reason is this: Now your libraries have to have the superset of all possible values that can possibly be selected into your dynamic list. If the last saved value does not exist in the original library list, then it returns a warning and resets the value to the first value in the list...and there is no way to intercept that message. We've invested many hours into trying to work around that particular issue and we have a workable solution that works fairly well.

Tex Mode with Rotating Simulink Blocks

This is another feature, The Mathworks "almost" got right. If you are developing masks in Simulink and you want to use Latex textual formatting, Simulink provides a neat command to format the text appropriately:

 text(.1,.9,lbl,'texmode','on','VerticalAlignment','Top','HorizontalAlignment','Left','0')

However, if you rotate the block that contains the mask (CTRL+R), then the text is rotated with the block and it is impossible to change it otherwise.

The 'text' command actually offers a property called 'Rotation' which would suggest that the text can be rotated:

 text(.1,.9,lbl,'texmode','on','VerticalAlignment','Top','HorizontalAlignment','Left', 'Rotation', '0')

However, when it is used, then the following error message is printed at the MATLAB prompt:

 Warning: The text property 'Rotation' is not supported in mask drawing.

External Links

Simulink - The Mathworks Website