Daniel@0: function M = sampleUniformInts(N, r, c) Daniel@0: Daniel@0: % M is an rxc matrix of integers in 1..N Daniel@0: Daniel@0: prob = normalize(ones(N,1)); Daniel@0: M = sample_discrete(prob, r, c);