function value = ch_to_digit_oct ( c ) %% CH_TO_DIGIT_OCT returns the integer value of an octal digit. % % Modified: % % 02 May 2004 % % Author: % % John Burkardt % % Parameters: % % Input, character C, the octal digit, '0' through '7'. % % Output, integer VALUE, the corresponding integer value, or % -1 if C was illegal. % if ( '0' <= c & c <= '7' ) value = c - '0'; elseif ( c == ' ' ) value = 0; else value = -1; end