Open in the MATLAB editor: f03ba_example
function f03ba_example fprintf('f03ba example results\n\n'); a = [ 33, 16, 72; -24, -10, -57; -8, -4, -17]; % Compute LU factorisation of a [a, ipiv, info] = f07ad(a); fprintf('\n'); [ifail] = x04ca('g', 'n', a, 'Array a after factorization'); fprintf('\nPivots:\n'); fprintf(' %d', ipiv); fprintf('\n\n'); [d, id, ifail] = f03ba(a, ipiv); fprintf('d = %13.5f id = %d\n', d, id); fprintf('Value of determinant = %13.5e\n', d*2^id);
f03ba example results Array a after factorization 1 2 3 1 33.0000 16.0000 72.0000 2 -0.7273 1.6364 -4.6364 3 -0.2424 -0.0741 0.1111 Pivots: 1 2 3 d = 0.37500 id = 4 Value of determinant = 6.00000e+00