fork download
%% Source code:
c=@(x,p)char(mod(idivide(x,1000*26^p),26)+65);
s=@(n)[c(n,3),c(n,2),num2str(mod(n,1000),'-%03d-'),c(n,1),c(n,0)];

%% chose some test cases
n = uint32([0;1;999;1000;675999;676000;456975999]) ;

% work out their plate numbers
s( n )
Success #stdin #stdout 0.06s 46472KB
stdin
Standard input is empty
stdout
ans =

AA-000-AA
AA-001-AA
AA-999-AA
AA-000-AB
AA-999-ZZ
AB-000-AA
ZZ-999-ZZ