function lvec_print ( n, a, title ) %*****************************************************************************80 % %% LVEC_PRINT prints a logical vector. % % Licensing: % % This code is distributed under the GNU LGPL license. % % Modified: % % 02 April 2005 % % Author: % % John Burkardt % % Parameters: % % Input, integer N, the dimension of the vector. % % Input, logical A(N), the vector to be printed. % % Input, string TITLE, a title to be printed first. % TITLE may be blank. % if ( 0 < s_len_trim ( title ) ) fprintf ( 1, '\n' ); fprintf ( 1, '%s\n', title ); end fprintf ( 1, '\n' ); for i = 1 : n value = ( a(i) ~= 0 ); fprintf ( 1, '%6d %1d\n', i, value ); end return end