clear; close all; clc; format rat;

%% Noncooperative game theory - Exercise 4


C = [ -1 5 -2 0        
      -3 5  0 5
       0 -4 1 -1
       -1 3 5 3 ];

[m,n] = size(C) ;

[sol,~,~,~,lambda] = linprog([zeros(m,1);1], [C' -ones(n,1)],...
    zeros(n,1), [ones(1,m) 0], 1, [zeros(m,1);-inf], []);

% Nash equilibrium

x = sol(1:m)
y = lambda.ineqlin


