07-Jan-2022 21:54:06 isbn_test(): MATLAB/Octave version 9.8.0.1380330 (R2020a) Update 2 Test isbn(). ch_is_digit_test() ch_is_digit() is TRUE if a character represents a digit. C CH_IS_DIGIT(C) "0" 1 "1" 1 "2" 1 "3" 1 "4" 1 "5" 1 "6" 1 "7" 1 "8" 1 "9" 1 "X" 0 "?" 0 " " 0 ch_is_isbn_digit_test(): ch_is_isbn_digit() is TRUE if a character represents an ISBN digit. C CH_IS_ISBN_DIGIT(C) "0" 1 "1" 1 "2" 1 "3" 1 "4" 1 "5" 1 "6" 1 "7" 1 "8" 1 "9" 1 "X" 1 "x" 1 "Y" 0 "?" 0 "*" 0 " " 0 ch_to_digit_test(): ch_to_digit() converts character -> decimal digit 1 "0" 0 2 "1" 1 3 "2" 2 4 "3" 3 5 "4" 4 6 "5" 5 7 "6" 6 8 "7" 7 9 "8" 8 10 "9" 9 11 "X" -1 12 "?" -1 13 " " -1 i4_to_isbn_digit_test(): i4_to_isbn_digit() converts digits 0 to 10 to an ISBN digit. 0 48 1 49 2 50 3 51 4 52 5 53 6 54 7 55 8 56 9 57 10 88 i4vec_print_test(): i4vec_print() prints an I4VEC The I4VEC: 1: 91 2: 92 3: 93 4: 94 isbn_check_digit_calculate_test(): isbn_check_digit_calculate() calculates the 10-th digit (the check digit) of a 10-digit ISBN. Check digit of "0-306-40615-2" is "2", expecting "2" Check digit of "0 8493 9640" is "9", expecting "9" Check digit of "158488059" is "7", expecting "7" Check digit of "246897531" is "6", expecting "6" Check digit of "135798642" is "4", expecting "4" isbn_digit_to_i4_test(): isbn_digit_to_i4() converts an ISBN digit to an I4 0 0 1 1 2 2 3 3 4 4 5 5 6 6 7 7 8 8 9 9 X 10 isbn_is_valid_test(): isbn_is_valid() reports whether a ISBN is valid. Validity of "0-306-40615-2" is 1, expecting 1 Validity of "0-326-40615-2" is 0, expecting 0 Validity of "0 8493 9640 9" is 1, expecting 1 Validity of "0 8493 9640 3" is 0, expecting 0 Validity of "0-3870-9654-X" is 1, expecting 1 Validity of "0-201-38597-x" is 1, expecting 1 s_to_digits_test(): s_to_digits() converts string -> digit vector Test string: "34E94-70.6" Extracted 5 digits: 1: 3 2: 4 3: 9 4: 4 5: 7 Test string: "34E94-70.6" Extracted 7 digits: 1: 3 2: 4 3: 9 4: 4 5: 7 6: 0 7: 6 s_to_isbn_digits_test(): s_to_isbn_digits() converts string -> ISBN digit vector Test string: "34E9X-70.6" Extracted 5 digits: 1: 3 2: 4 3: 9 4: 10 5: 7 Test string: "34E9X-70.6" Extracted 7 digits: 1: 3 2: 4 3: 9 4: 10 5: 7 6: 0 7: 6 isbn_test(): Normal end of execution. 07-Jan-2022 21:54:06