% A script file to solve the following 5 x 5 system % % % c f1 + f2 = 0 % f2 - 2 f3 + f4 = 5 % f1 + c f3 = 4 % 3 f1 + 7 f5 = -1 % f2 - c f4 = 2 % % where c = sqrt(2); % % Rewrite this as an Ax=b problem, or Af=b. % % c 1 0 0 0 f1 0 % 0 1 -2 1 0 f2 5 % 1 0 c 0 0 f3 = 4 % 3 0 0 0 7 f4 -1 % 0 1 0 -c 0 f5 2 % Here's a slick way to enter the above matrix c = sqrt(2); A = zeros(5,5); A(1, [1 2]) = [ c 1 ]; A(2, [2 3 4]) = [ 1 -2 1 ]; A(3, [1 3]) = [ 1 c ]; A(4, [1 5]) = [ 3 7 ]; A(5, [2 4]) = [ 1 -c ]; b = [0 5 4 -1 2]'; f = A\b;