chinese_char = ['云','京','冀','吉','宁','川','新','晋','桂','沪','津','浙','渝','湘',...
'琼','甘','皖','粤','苏','蒙','藏','豫','贵','赣','辽','鄂','闽','陕','青',...
'鲁','黑'];
eng_char = ['A','B','C','D','E','F','G','H','J','K','L','M','N','P','Q',...
'R','S','T','U','V','W','X','Y', 'Z'];
num_char = ['0','1','2','3','4','5','6','7','8','9'];
% 生成随机汉字
char_index = randi(31,1);
char = chinese_char(char_index); % 生成随机字母
eng_index = randi(24,1);
eng = eng_char(eng_index);
% 生成随机数字
num_index = randi([1,10],1,5);
num = num_char(num_index(:));
rand_LP = [char,eng,num];
fid = fopen('E:\diao\LicensePlateRecognition\source\rand_LP.txt','a');
fprintf(fid,'%s\r\n',rand_LP);
随机生成车牌字符,并写入txt文件中。