這個語法可以驗證一個身分證字號是不是合法的
function out = checkId(id)
first = [10:17 34 18:22 35 23:29 32 30 31 33];
a = uint8(upper(id));
b = zeros(1,11);
b(1:2) = uint8(num2str(first(a(1)-64)));
b(3:11) = uint8(a(2:10))-48;
out = mod([1 9 8 7 6 5 4 3 2 1 1]*b',10);