function c_inc = digit_inc ( c ) % C_INC increments a digit. % % Discussion: % % 0 goes to 1, 1 goes to 2 and so on, but 9 goes back to 0. % % Modified: % % 14 June 2003 % % Author: % % John Burkardt % % Parameters: % % Input, character C, a character. % % Output, character C_INC, the incremented character. % if ( '0' <= c & c < '9' ) c_inc = char ( 1 + double ( c ) ); elseif ( c == '9' ) c_inc = '0'; else c_inc = ' '; end