function A = frank_inv ( n ) % % function A = frank_inv ( n ) % % FRANK_INV returns the inverse of the Frank matrix. % % Modified: % % 14 February 2000 % % Parameters: % % Input, integer N, the order of the matrix. % % Output, real A(N,N), the inverse Frank matrix. % A = zeros ( n, n ); for i = 1 : n for j = 1 : n if ( i == j-1 ) A(i,j) = - 1.0; elseif ( i == j ) if ( i == 1 ) A(i,j) = 1.0; else A(i,j) = n + 2 - i; end elseif ( i > j ) A(i,j) = - ( n + 1 - i ) * A(i-1,j); else A(i,j) = 0.0; end end end