% Cows and chicken example: consider a farm where there are only cows and
% chicken. We know that there are 98 feet and 39 heads at the farm.
%
% Question: how many cows and how many chicken are there?
%
% Samuli Siltanen October 2013
% Number of feet
y1 = 98;
% Number of heads
y2 = 39;
% Collect the data into a vector.
y = [y1;y2];
% Construxt the system matrix.
A = [[4 2];[1 1]];
% Solve the problem. What is the answer to the above question?
x = inv(A)*y