%% Create OptimizationInequality Array
% Create a 4-by-6 optimization variable matrix named x.

x = optimvar('x',4,6);

% Create the inequalities that each row of x sums to no more than one.

constrsum = sum(x,2) <= 1

% View the inequalities.

show(constrsum)

% To include the inequalities in an optimization problem, set a Constraints property to constrsum by using dot notation.

prob = optimproblem;
prob.Constraints.constrsum = constrsum

% Copyright 2019 The MathWorks, Inc.