%% Solve Linearly Constrained Minimax Problem
% The objective functions for this example are linear plus constants. For a description and plot of the objective functions, see Compare fminimax and fminunc.
% Set the objective functions as three linear functions of the form {\rm dot}(x,v) + v_0
%  for three vectors v and three constants v_0.

a = [1;1];
b = [-1;1];
c = [0;-1];
a0 = 2;
b0 = -3;
c0 = 4;
fun = @(x)[x*a+a0,x*b+b0,x*c+c0];

% Find the minimax point subject to the inequality x(1) + 3*x(2) <= –4.

A = [1,3];
b = -4;
x0 = [-1,-2];
x = fminimax(fun,x0,A,b)

% Copyright 2018 The MathWorks, Inc.