% MPCLIBDEMO Invokes demos for MPC Smulink Library
%
% A. Bemporad, Dec 21, 2000

pathsave=pwd;
fun='mpcsfun.m';
w=which(fun);
eval(['cd ''' w(1:end-length(fun)) '''']);
cd demos

fprintf('\n\nChoose MPC Simulink demo:\n\n');
fprintf('1. MPC Reference Tracking\n');
fprintf('2. MPC Disturbance Rejection\n');
fprintf('3. MPC with Anticipation\n');
fprintf('4. MPC Regulation\n\n\n');

thedemo=input('Your choice: ');

switch thedemo
case 1
   ex3;
   disp('Press any key');pause
   open('ex3');
case 2
   ex1;
   disp('Press any key');pause
   open('ex1');
case 3
   ex1a;
   disp('Press any key');pause
   open('ex1a');
case 4
   ex9;
   disp('Press any key');pause
   open('ex9');
end

eval(['cd ''' pathsave '''']);
