% Unit 3 (MATLAB Course @ UAM)
% (c) Alexander Knebe

%=====================================
% buying a new suitcase for flights
%=====================================
clear all
format long

% airline constraint x+y+z=158cm
a11 = 1;
a12 = 1;
a13 = 1;
b1  = 158;

% constraints to comply with DIN A norm
a21 = -sqrt(2);
a22 = 1;
a23 = 0;
b2  = 0;

a31 = 0;
a32 = -sqrt(2);
a33 = 1;
b3  = 0;

% generate matrix A and vector b
A = [a11, a12, a13; a21, a22, a23; a31, a32, a33];
b = [b1; b2; b3];

% solve for dimensions of suitcase
suitcase_method1 = mldivide(A,b)
suitcase_method2 = A\b
suitcase_method3 = inv(A)*b

