function M = sample_discrete_C(prob, r, c)
% SAMPLE_DISCRETE Like the built in 'rand', except the elements of M are drawn from a discrete distrib.
% M = sample_discrete(prob, r, c)


if nargin == 1
  r = 1; c = 1;
elseif nargin == 2
  c == r;
end

M = C_sample_discrete(prob, r, c);
