%x1 = [0, 0, 0, 5, 5, 5, 10, 10, 10, 15, 15, 15, 20, 20, 20, 25, 25, 25, 30, 30, 30];
%x2 = [0, 10, 20, 0, 10, 20, 0, 10, 20, 0, 10, 20, 0, 10, 20, 0, 10, 20, 0, 10, 20]; 
x1 = [0; 5; 10; 15; 20; 25; 30; 0; 5; 10; 15; 20; 25; 30;0; 5; 10; 15; 20; 25; 30];
x2 = [0; 0; 0; 0; 0; 0; 0; 10; 10; 10; 10; 10; 10; 10; 20; 20; 20; 20; 20; 20; 20];
y = [ 14.6; 12.8; 11.3; 10.1; 9.09; 8.26; 7.56; 12.9; 11.3; 10.1; 9.03; 8.17; 7.46; 6.85; 11.4; 10.3; 8.96; 8.08; 7.35; 6.73; 6.2];

plot3(x1, x2, y, 'rs');

hold all;

X= [ones(size(x1)), x1, x2]; 
b = regress(y, X); 
   
a0 = 13.522142857142860;
a1 = -0.201238095238095;
a2 = -0.104928571428572;

y = a0 + a1*x1 + a2*x2;

plot3(x1, x2, y);

j = a0 + a1*17 + a2*5;

j