%% Display Optimization Variable Bounds
% Show bounds for various optimization variables.
% Create a continuous optimization variable array and display its bounds.

x = optimvar('x',2,2);
showbounds(x)

%
% Set lower bounds of 0 on all elements of x, and set upper bounds on the first row.

x.LowerBound = 0;
x.UpperBound(1,:) = [3,5];
showbounds(x)

%
% Create a binary optimization variable array and display its bounds.

binvar = optimvar('binvar',2,2,'Type','integer',...
    'LowerBound',0,'UpperBound',1);
showbounds(binvar)

%
% Create a large optimization variable that has few bounded elements, and display the variable bounds.

bigvar = optimvar('bigvar',100,10,50);
bigvar.LowerBound(55,4,3) = -20;
bigvar.LowerBound(20,5,30) = -40;
bigvar.UpperBound(35,3,35) = -200;
showbounds(bigvar)

%
% Copyright 2012 The MathWorks, Inc.