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)

For more examples, see sdpvar.

Leave a Comment