| Contents | Index |
The following state uses a multiline label:

There are two ways to enter multiline labels for states and transitions. In the following examples, sA is a handle to the State object in the chart for state A:
Use the MATLAB function sprintf:
str = sprintf('A\nen: entrA()\ndu: duriA()\nex: exitA()');
sA.LabelString = str;
In this example, the escape sequence \n inserts carriage returns into a string expression.
Use a concatenated string expression:
str = ['A',10,'entr: entrA()',10,'du: duriA()',...
10,'ex: exitA()'];
sA.LabelString = str;
In this example, the ASCII equivalent of a carriage return, the integer 10, inserts carriage returns into a concatenated string expression.
![]() | Using the Editor Object | Creating Default Transitions | ![]() |

Learn how engineers use Stateflow to model state machines in their Simulink models.
| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |