所以我熟悉randsrc并且我可以使用给定概率的整数随机字母表创建.所以我想说我有这个字母表
alphabet={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
prob=[0.08167 0.01492 0.02782 0.04254 0.12702 0.02228 0.02015 0.06094 0.06966 0.00153 0.00772 0.04025 0.02406 0.06749 0.07507 0.01929 0.00095 0.05987 0.06327 0.09056 0.02758 0.00978 0.02360 0.00150 0.01974 0.00074];
注意:字母表是1×26维度的单元格,prob是1×26双数组.
我可以像这样创建一个随机字符串
s = 'abcdefghijklmnopqrstuvwxyz';
%find number of random characters to choose from
numRands = length(s);
%specify length of random string to generate
sLength = 10;
%generate random string
randStri