Pseudorandom character matrix generation
Show older comments
Generate a 10x10 matrix with the letters 'b', 'd', 'p', 'q' in randomized order. Every refresh should produce a new randomized matrix.
This is to simulate the bdpq test. Should be a pretty simple task, but seems to be otherwise!
Accepted Answer
More Answers (1)
s = {'b', 'd', 'p', 'q' } ;
S = cell(10) ;
for i = 1:10
for j = 1:10
t = s(randperm(4,4)) ;
S{i,j} = [t{:}] ;
end
end
S
Categories
Find more on Random Number Generation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!