fork download
  1. %% Source code:
  2. c=@(x,p)char(mod(idivide(x,1000*26^p),26)+65);
  3. s=@(n)[c(n,3),c(n,2),num2str(mod(n,1000),'-%03d-'),c(n,1),c(n,0)];
  4.  
  5. %% chose some test cases
  6. n = uint32([0;1;999;1000;675999;676000;456975999]) ;
  7.  
  8. % work out their plate numbers
  9. s( n )
  10.  
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