Documentation

modes

Declare operating modes in mode chart

Syntax

modes mode m1 ... end mode m2 ... end end     

Description

modes begins a modes declaration block in a mode chart. The modes block, terminated by an end keyword, can contain one or more mode constructs. Each mode construct declares one mode.

For example, the following syntax declares two modes, m1 and m2.

modes
    mode m1
    ...
    end
    mode m2
    ...
    end
end

mode is a named construct. It is terminated by an end keyword. Each mode declaration contains a complete set of equations that describe this operating mode.

modes
    mode m1
       equations
       ...
       end
    end
    mode m2
       equations
       ...
       end
    end
end

For every mode, the total number of equation expressions, their dimensionality, and their order must be the same. This restriction is the same as for the equations in different branches of the if-elseif-else statement.

This restriction does not apply to the assert expressions, because they are not included in the expression count.

Introduced in R2017a

Was this topic helpful?