binvar

binvar is used to define decision variables constrained to be binary (0 or 1).

Syntax

x = binvar(n)
x = binvar(n,m,)
x = binvar(n,m,'type'
x = binvar(n,m,'type','field')
binvar x

Examples

A scalar binary variable is defined with

P = binvar(1)

A related alternative command is binary.

For more examples, see sdpvar.