Getting Started Previous page   Next Page

switch and case

The switch statement executes groups of statements based on the value of a variable or expression. The keywords case and otherwise delineate the groups. Only the first matching case is executed. There must always be an end to match the switch.

The logic of the magic squares algorithm can also be described by


Previous page  Flow Control for Next page

© 1994-2005 The MathWorks, Inc.